WordPress网站XML地图(站点地图)是网站收录一个重要的环节,我们生成sitemap.xml文件时,打开它可能会出现报错的现象!
错误内容如下:
error on line 1 at column 6: XML declaration allowed only at the start of the document
下面大头教大家解决WordPress网站XML地图报错的问题。
报错解决方法:
1、打开网站根目录的wp-blog-header.php文件(将下面的代码进行复制替换掉里面的代码)。
<?php if ( ! isset( $wp_did_header ) ) { $wp_did_header = true;ob_start(); // Load the WordPress library. require_once __DIR__ . '/wp-load.php'; // Set up the WordPress query. wp(); ob_end_clean(); // Load the theme template. require_once ABSPATH . WPINC . '/template-loader.php'; }
2、替换完毕后保存即可。
感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
暂无评论内容