> 做站经验技巧 > wordpress的sitemap地图常见报错 (Error on line 1 at column 6: XML declaration allowed only at the start of the doc)

wordpress的sitemap地图常见报错 (Error on line 1 at column 6: XML declaration allowed only at the start of the doc)

WordPress程序报错的问题

报错代码如下:

This page contains the following errors:

error on line 1 at column 6: XML declaration allowed only at the start of the document

Below is a rendering of the page up to the first error.

wordpress的sitemap地图常见报错 (Error on line 1 at column 6: XML declaration allowed only at the start of the doc)

sitemap报错的解决办法:

通常修改网站根目录的wp-blog-header.php文件即可。

本文件仅几行代码,修改为

if ( !isset($wp_did_header) ) { 

	$wp_did_header = true; ob_start(); 

	// Load the WordPress library.
	require_once( dirname(__FILE__) . '/wp-load.php' ); ob_end_clean(); 

	// Set up the WordPress query.
	wp();

	// Load the theme template.
	require_once( ABSPATH . WPINC . '/template-loader.php' );

}

 

wordpress的sitemap地图常见报错 (Error on line 1 at column 6: XML declaration allowed only at the start of the doc)

 

对于这种问题大家并不陌生,小白一般会选择更换其它sitemap插件,对于wp大家可以自备两个sitemap插件,各取所长。

 

wordpress sitemap下载地址

https://www.xiaoboy.cn/jiqiao/825.html