Back to Top

Better WordPress Google XML Sitemaps

Better WordPress Google XML Sitemaps

The first WordPress XML Sitemap plugin that comes with comprehensive support for Google News sitemap, Sitemap Index and Multi-site. Extend functionality via flexible modules, not just hooks!

Frequently Asked Questions

404 / Not Found Errors

When I visit, I see a WordPress “404 / Not Found” page. What should I do?
This might be caused by unflushed rewrite rules, which should have been flushed when you activate this plugin. You can try flushing them manually by visiting Settings >> Permalinks and then clicking Save Changes.
When I visit any sitemap, a plain (no theme) 404 error page appears / I got an HTTP parse error when I submit sitemap to Google Webmaster Tools, what should I do?

See this answer first, if that doesn’t help, and you are using a cache plugin (such as WP Super Cache or W3 Total Cache), it is possible that such plugin is interfering with BWP sitemaps’ output.

For WP Super Cache

On the Advanced Tab, scroll to the Accepted Filenames & Rejected URIs section, and then in the first textarea, type in \.xml. Now save changes, and flush/delete all caches.

For W3 Total Cache ( and later)

Go to Performance >> Browser Cache, and then go to 404 error exception list in the General option block, and find this line:


OR this line:


and change it to:


Save the changes and then tell W3TC to auto-install the rewrite rules to your .htaccess file.

Google News

Google seems to mistake some non-news contents as news even though I’ve submitted the news sitemap, what’s wrong?
You need to tell Google to crawl news contents from your news sitemap exclusively, using this form. More info here: ... 4897?hl=en
Sometimes my Google News sitemap shows an error, Google complains too, what’s wrong?

Google seems to only accept articles that are NOT older than two days, see ... guidelines , and this plugin does just that: only include articles that are published within a two-day period. If there’s none, the sitemap returns a 404 error.

As of version 1.4.0, you can customize this behavior by setting a “News age” (via BWP Sitemaps >> Extensions >> Google News Sitemap >> Sitemap Contents). You can set this option to the desired number of days to keep an article (default to 2), or simply set to 0 to keep all articles (not recommended).


I keep getting 404 errors when trying to generate my sitemaps, what’s the problem?

This could happen with certain nginx setups when you enable pretty permalinks. For now you can fix this by rewriting sitemap urls like so:

server {
    rewrite ^/sitemapindex\.xml$ /index.php?gxs_module=sitemapindex last;
    rewrite ^/post\.xml$ /index.php?gxs_module=post last;
    rewrite ^/page\.xml$ /index.php?gxs_module=page last;

    rewrite ^/post_google_news\.xml$ /index.php?gxs_module=post_google_news last;
    rewrite ^/taxonomy_category\.xml$ /index.php?gxs_module=taxonomy_category last;

General Questions

I can’t seem to find any sitemaps under my website’s root directory, where are they?
All sitemaps are generated on the fly (i.e. only when needed) so there’s no actual sitemap files for you to find. In fact, there are sitemap files but they are compressed and cached in a separate cache directory (which you can configure). However, those sitemap files are meant to be used internally by this plugin instead of being served directly.
My sitemap is located at (no www), however when I try to submit to Google, it keeps adding the www, why?
This is a common issue, please take a look at: ... 4231?hl=en
My sitemaps seem to be using an incorrect timezone, why?
Make sure that you’re not enabling GMT timezone for your sitemaps. This setting can be found at BWP Sitemaps >> Advanced Options >> Formatting.
I got white pages and/or ‘Content Encoding Error’ error?
  1. PHP error messages from other plugins or from this plugin itself can cause this issue, especially when you have WP_DEBUG set to true. Refer to a Q&A below to know how to trace the actual errors.

  2. BWP GXS runs out of memory or reaches maximum execution time. This often happens when you try to build large sitemaps. I’ve tried to optimize this plugin a lot since the first version, but if you are using a lot of memory eating plugins on your website, it is very hard for BWP GXS to build huge sitemaps (containing tens of thousands of items).

    Anyway, to resolve this issue, try decreasing the three limit options in the Generator tab:

    • Max number of items per sitemap (first option)
    • Max number of items per split sitemap (first option in Sitemap Index
    • Options)
    • Max items to get in one SQL query (second option in Module Options).

    You might try the following presets (in the same order as above):

    • 1000, 1000, 100 (for sites with low memory limit like 32MB)
    • 5000, 5000, 500 (for sites with lots of posts, tags, categories, etc.)
    • 5000, 5000, 2500 (if you have problem with max execution time)

    Also, you can try the tips mentioned in this post of mine.

  3. A caching plugin might be interfering. You need to tell that caching plugin to ignore .xml file. See below for some examples.

I got the error ‘Content Encoding Error’ error, what should I do?

If you are enabling WordPress’s debugging mode, i.e. having define('WP_DEBUG', true) in your wp-config.php, this error is very normal, because the module you use might print errors on pages, thus corrupting your xml sitemaps.

To view the actual errors without being greeted with the ‘Content Encoding Error’ error, please follow these steps:

  1. Navigate to BWP Sitemaps >> Advanced Options >> Debugging and enable “extra debugging mode”.
  2. Refresh any sitemap with ‘Content Encoding Error’ error.
  3. Report the error you see

As a last resort, you can try locating the error_log file within your WordPress installation’s root directory and read its contents for the error messages.

I choose not to display certain sitemaps but the sitemap index still displays them?
What you see is actually a cached version of the sitemap index. You can wait for it to be refreshed automatically or manually refresh it yourself. See this for more details.
I try to flush cache but got this error: “Could not flush the cache, cache directory is either not found or is not writable.”, what should I do?

If you see this error, try the following:

  • Check your current cache directory. Navigate to BWP Sitemaps >> Advanced Options >> Sitemap Cache and see what directory is being used as the cache directory. You must make sure that this directory exists and is writable (i.e. CHMOD to 755 or 777).
  • If you’re using the default cache directory, try moving it to a different directory where you normally store your cached contents, such as wp-content/cache. Create a new directory, for e.g. wp-content/cache/bwp-sitemaps and then set it as your cache directory. Note that you must use the absolute path, i.e. /home/user/path/to/cache.
I got an ‘Error loading stylesheet’ error, what should I do?
As of version 1.1.0 it is almost impossible for such error to show up, but if you set the site url and the home url differently (one with www and one isn’t), you will see this error. Just choose to disable stylesheet in Generator tab or change your site / home URL settings.
BWP GXS tells me that ‘Requested module not found or not allowed’, what should I do?
This depends on specific situations and your current settings. Basically this means that the module you’re trying to access has not been registered with BWP GXS or that module has been disabled but the cached sitemapindex still displays it (which is related to the question above). For a list of default modules (or sitemaps), please read this section.
Is there anyway to rename sitemapindex.xml to sitemap.xml?
You don’t have to. A visit to will show you the same sitemapindex. This is done to make BWP GXS more compatible with blogs that have lots of real robots.txt. Please note that you must remove any real sitemap.xml file in your website’s root for this feature to work.
The custom sitemapindex I create seems to be nested inside the default sitemapindex, is that a bug or something?
That’s the default behaviour of this plugin and I plan to improve it in future versions. Don’t worry, though, you might see a red X next to your sitemapindex’s name in Google’s Webmaster Tools but that’s only because you haven’t submitted your custom sitemapindex. If you submit it separately, the error will go away :).
Print Article Plugin Update Feed