Sitemap Error : XML declaration allowed only at the start of the document解决方法

  Today ytkah said his client feedback xml site map in question, suggesting Sitemap Error: XML declaration allowed only at the start of the document, this may be a great topic function.php wp-config.php file or have extra space / blank lines , opening his function.php looked and found at last add some definitions

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

  This is another played a <? Php?>, Try to remove it, and then remove the definition to the front of the package, the preservation upload cover, update the cache, update cdn, then visit about xml site map will not appear in front of the error.

  参考资料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.

Guess you like

Origin www.cnblogs.com/ytkah/p/11647056.html