zoukankan      html  css  js  c++  java
  • Sitemap Error : XML declaration allowed only at the start of the document解决方法

      今天ytkah的客户反馈说他的xml网站地图有问题,提示Sitemap Error : XML declaration allowed only at the start of the document,这个很大的可能是wp-config.php或主题function.php文件中有多余的空格/空行,打开他的function.php看了一下,发现在最后加了一些定义

    <?php
    remove_action('wp_head', 'rsd_link');
    remove_action('wp_head', 'wlwmanifest_link');
    ?>
    

      这个是另起了一个<?php ?>,试着把它去掉,然后把remove定义放到前面的封装里,保存上传覆盖,更新缓存,更新cdn,再访问一下xml网站地图不会出现前面的错误提示了。

      参考资料However, the cause most often is an empty line at the beginning (before the <?php line) or end of the wp-config.php or functions.php file. If there is no empty line in these files, we highly recommend running a conflict check to identify what outputs the empty whitespace. You may also need to clear your caching from your plugins/theme/CDN such as Cloudflare/server caching etc.

  • 相关阅读:
    2019hdu多校1
    codefroce842C
    [codeforce686D]树的重心
    [codeforce1188C&D]
    Educational Codeforces Round 66
    [hdu4343]interval query
    Luogu 4234 最小差值生成树
    BZOJ 2594 水管局长
    Luogu 2173 [ZJOI2012]网络
    Luogu 2147 洞穴勘测
  • 原文地址:https://www.cnblogs.com/ytkah/p/11647056.html
Copyright © 2011-2022 走看看