WordPress website map sitemap.xml error repair
Error overview
In building a website using WordPress, use the XML Sitemaps plug-in to create a sitemap.xml site map, but after creation, open sitemap.xml and report the following error
Solution
1. Find the wp-blog-header.php file in the root directory of the website and open it. Modify it as follows
<?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. Refresh sitemap.xml to find that it can be used
Read More:
- Win10 starts infinite loop auto repair, and the repair fails
- WordPress: How to Remove the directory name in the link
- Solve the problem of “A TimThumb error has occured” in the WordPress program
- Map to vector pair map.second sort
- Error handling when ABP specifies map object during map operation
- wordpress :This block has encountered an error and cannot be previewed
- Android 9 (P) recovery upgrade Map of ‘@/cache/recovery/block.map’ failed problem analysis guide
- Easynvr operation log reports an error. Fatal error: concurrent map read and map write troubleshooting
- [go] solve the fatal error of go: concurrent map writes map non concurrent security
- WordPress cannot install themes and plugins online: wp_remote_post failed:
- Chrome browser settings cause err when accessing the website_ FAILED
- Xcode – pbxcp Error Repair – no such file or directory
- BibTeX: How to cite a website
- WordPress prompts the solution of “an error occurred while clipping your image.”
- Error parsing Mapper XML. The XML location is ‘file
- Error in reading XML file IOException parsing XML document from URL
- Causes and solutions of WordPress media library pictures not showing or showing errors
- SQL injection for ASP + access website
- Wamp install WordPress prompt can’t select database
- R Error: XML content does not seem to be XML: ‘input.xml’