• 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.

  • 相关阅读:
    SignalR + MVC5 简单示例
    SignalR 简单示例
    Web API 简单示例
    Windows Azure 使用体验
    SQL Server 2014 安装小记
    SSRS 迁移
    SSH配置(同一服务器不同用户)
    【6】Zookeeper脚本及API
    【3】Kafka安装及部署
    【2】Kafka概念及原理
  • 原文地址:https://www.cnblogs.com/ytkah/p/11647056.html
Copyright © 2020-2023  润新知