Back to Top

Better WordPress Google XML Sitemaps – Released!

Previous Post:

Better WordPress Google XML Sitemaps – Released!

My 7th plugin, Better WordPress Google XML Sitemaps (or BWP GXS for short), has been released! This is the first WordPress XML Sitemap plugin that comes with comprehensive support for Sitemapindex and Multi-site. It is no ordinary plugin, you can simply use it, or build custom things on it with unrivaled flexibility!

Features at a glance

  • By default, this plugin allows you to create a sitemapindex that contains the following sitemaps: posts (including custom post types), static pages, taxonomy archives (including custom taxonomies) and date archives. You can of course enable or disable any of them.
  • Provide all basic options for creating sitemaps, such as:
    • Maximum number of items per sitemaps
    • Default change frequency
    • Default priority
    • Minimum priority
  • Allows you to add the sitemap to WordPress’s virtual robots.txt. If you have a sub-domain Multi-site installation, each blog will have its own robots.txt. Of course this only works if you don’t have a physical robots.txt in the main site’s root.
  • Allows you to style your sitemaps using a built-in XSLT style sheet, or custom-made ones.
  • Allows you to compress you sitemaps, thus making them approximately 70% smaller.
  • Allows you to ping search engines (Google, Bing, Yahoo, and Ask) when you:
    • Publish a new post
    • Publish a draft
    • Publish a pending post
    • Publish a scheduled (future) post
  • And more advanced features!

The current formal version is 1.0.0 (bug fix release: 1.0.5) and you can find detailed documentation on this plugin’s official page.

If you need anything, just comment below!

Take Social Sharing to
the Next Level with Monarch!

Take Social Sharing to the Next Level with Monarch!
Print Article Trackback Trackback to this Article   Subscribe to Comments RSS Subscribe to Comments RSS

44 Opinions for Better WordPress Google XML Sitemaps – Released!

  1. User's Gravatar
    Tuffclassified April 17, 2011 at 2:30 am – Permalink

    It is not working on our website at (RESOLVED!).

    • User's Gravatar
      OddOneOut April 17, 2011 at 7:39 am – Permalink

      Hi! Thanks for trying the plugin.

      What is the error message that you see? What caching plugin are you using? It seems to be a caching issue. If you have time please try the following:

      1. Enable this plugin’s debug mode (in Sitemap Statistics Page) and WP_DEBUG (in config.php).
      2. Open the file class-bwp-simple-gxs.php inside bwp-google-xml-sitemaps/includes/ and look for this function: output_sitemap().
      3. Place an exit; right after the opening bracket, like so:

      function output_sitemap()

      4. Visit
      5. Please post any error message you see. Thanks!

      • User's Gravatar
        Tuffclassified April 17, 2011 at 8:59 am – Permalink

        I get no debug info just white screen when i try to access sitemapindex.xml or

      • User's Gravatar
        Tuffclassified April 17, 2011 at 9:00 am – Permalink

        and i am using W3 Total Cache

        • User's Gravatar
          OddOneOut April 17, 2011 at 4:02 pm – Permalink

          Okay I will look into this problem right way, thanks.

        • User's Gravatar
          OddOneOut April 17, 2011 at 9:22 pm – Permalink

          Hello, after spending some time with W3 Total Cache I think there’s some problems with your .htaccess file. Please follow these steps:

          1. Enable WP_DEBUG (in wp-config.php) and also enable this plugin’s debug mode.
          2. Add the snippet below before # BEGIN W3TC ... something in your .htaccess file:

              RewriteEngine On
              RewriteBase /
              RewriteRule ^sitemapindex\.xml$ index.php?gxs_module=sitemapindex [NC,L]

          3. Visit
          4. If you got a Content Encoding Error or a white screen, we’re on the right track.

          • User's Gravatar
            Tuffclassified April 17, 2011 at 9:43 pm – Permalink

            Thanks for replying back

            it printout this thing private contents

        • User's Gravatar
          OddOneOut April 17, 2011 at 9:51 pm – Permalink

          It’s nice to have some errors, really! Tuff do you have Skype or something? We need to discuss this in a quicker way, you know. I’m available now, just send an email to with a mean to contact you directly (Gtalk, Skype, anything).

  2. User's Gravatar
    Basho April 19, 2011 at 6:51 pm – Permalink

    Installed and liking it a lot. Having some issues with Google Webmaster Tools though, getting Red X’s next to posts.xml, taxonomy_categories.xml and taxonomy_post_tags.xml

    Here is a link to my list of plugins:

    Hope you can help – love the program!



    • User's Gravatar
      Basho April 19, 2011 at 7:02 pm – Permalink

      I have disabled a few plugins and now get:

      Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error.

      • User's Gravatar
        Basho April 19, 2011 at 7:08 pm – Permalink

        Followed the FAQ for this error and now get a blank screen

        • User's Gravatar
          OddOneOut April 19, 2011 at 8:00 pm – Permalink

          Hi Basho,

          A blank screen is a good start, that is because you have placed exit; as suggested in the plugin’s FAQ section. Have you turned on this plugin’s debug mode? Please also try turning on WP_DEBUG and see if there’s any error pop up.

          Btw, why is there two taxonomy_post_tags.xml in your sitemapindex? Did you add a new module or something?

          I can help you fix this quickly if you can set up a temporary FTP account for me. Otherwise this could be a little bit long and tedious process ;).

        • User's Gravatar
          OddOneOut April 19, 2011 at 8:36 pm – Permalink

          You are using a lot of plugins there… Anyway, please try disabling All in one SEO and then disable debug mode, turn off WP_DEBUG, see if that works for you. I see that you’re using WP Super Cache, let me see if there’s any incompatibility…

          • User's Gravatar
            Basho April 19, 2011 at 8:43 pm – Permalink

            OK have done –

            Debug off, “exit;” removed, All in one SEO disabled, flushed caches

            No dice 🙁

            It could be super cache for sure, I would need to setup one of the others if this is the fault.

        • User's Gravatar
          OddOneOut April 19, 2011 at 9:13 pm – Permalink

          Hmm I have just tested my plugin with WP Super Cache and they seem to play nice with each other. Have you tried disabling WP Super Cache? I don’t think WP Super Cache is interfering with BWP GXS anyway because your sitemapindex.xml, pages.xml still look fine… It’s the module we need to debug now. Please make a temporary FTP account or something so I can help you easier.

  3. User's Gravatar
    Basho April 19, 2011 at 9:13 pm – Permalink

    BINGO! I have swapped to W3 Cache and it now works fine. Many thanks for the help

    • User's Gravatar
      OddOneOut April 19, 2011 at 9:15 pm – Permalink

      Are you sure? taxonomy_categories.xml is still empty? And there is still two taxonomy_post_tags.xml…

  4. User's Gravatar
    Kiddie April 24, 2011 at 10:46 am – Permalink

    You don’t know how long I’ve been waiting for a plugin like this! Thnks so much!

  5. User's Gravatar
    abel April 29, 2011 at 10:36 pm – Permalink

    First of all… great plugin and thanks! Have been trying to create my own module, read through your instructions thoroughly but am getting a 404 on the xml. Can add_module and it displays in the sitemapindex.xml.
    Am running a custom query on a table… here is the code…

    	function __construct()
    	function generate_data()
    		global $wpdb, $bwp_gxs;
    		$ad_table = $wpdb->prefix . 'awpcp_ads';
    		$properties_query = 'SELECT ad_id, ad_title, ad_category_id, disabled, ad_startdate, flagged 
    							FROM'. $ad_table .' 
    							ORDER BY ad_startdate DESC';     
    		$properties = $this->get_results($properties_query);                   
    		if (!isset($properties) || 0 == sizeof($properties))
    			return false;
    		$data = array();
    		foreach ($properties as $property)
    			if ($property->flagged !=1 || $property->disabled == 0) {
    				$data = $this->init_data($data);
    				$ad_id = $property->ad_id;
    				$data['location'] = 'something';//url_showad($ad_id);
    				$data['lastmod'] = $this->format_lastmod(strtotime($property->ad_startdate));
    				$data['freq'] = 'daily';
    				$data['priority'] = '0.8';
    				$this->data[] = $data;
    		// Always return true if we can get here, otherwise you're stuck at the SQL cycling limit
    		return true;

    Do you have any pointers as where am going wrong?

    • User's Gravatar
      abel April 29, 2011 at 10:38 pm – Permalink

      oops, not sure what went on with all the line breaks and paragraph tags!

      • User's Gravatar
        OddOneOut April 30, 2011 at 12:01 am – Permalink

        Hi Abel,

        You should use <pre> tag for a block of codes, <code> tag is for inline codes.

        The reason why you have a 404 is your rewrite rules have not been updated and (probably) you haven’t added your own rewrite rules. So, try this (put this snippet near the place where you add the module):

        add_filter('bwp_gxs_rewrite_rules', 'add_rewrite_rules');
        function add_rewrite_rules()
        	$my_rules = array(
        		'properties\.xml' => 'index.php?gxs_module=properties'
        	return $my_rules;

        Next, go to Permalink Settings and click Save Changes. Your properties.xml should now be available :).

      • User's Gravatar
        OddOneOut May 2, 2011 at 8:56 pm – Permalink

        Hi I just realized that you had a coding error on line 14 of the above snippet:

        FROM'. $ad_table .'

        You must have a space after the FROM keyword, i.e.:

        FROM '. $ad_table .'

        otherwise you will be greeted with an SQL error and the custom sitemap will have no item.

  6. User's Gravatar
    abel May 2, 2011 at 9:20 pm – Permalink

    Fantastic… you da man! Been really busy so only just saw your replies and you’ve solved it for me! All works perfectly.

    Thank you so much for your help! Great plugin btw.

  7. User's Gravatar
    Nat Colley May 3, 2011 at 3:29 pm – Permalink

    I just installed your plugin for google sitemaps on my test site ( I got NEITHER a menu item NOR a settings link, so apparently I can’t configure it at all. HOWEVER, I DO have a sitemapindex for the main site, exactly where you said it should be, so I’m confused. Is the plugin working for me or not? How do I access the configuration or any other controls?

    Note that I can’t access the sitemap for the subdomain ( but that may be a problem unrelated to your plugin.

    I look forward to hearing from you. Thx.

    • User's Gravatar
      Nat Colley May 3, 2011 at 3:31 pm – Permalink

      p.s. – I went the network activation route since I am super admin. Does that make a difference here?

      • User's Gravatar
        OddOneOut May 3, 2011 at 4:05 pm – Permalink

        Hi Nat, thanks for using the plugin.

        If you are in the Network Admin area (i.e. , of course you won’t see any Settings or Menu, this is by WordPress’s design.

        So, after you network activated this plugin, you can go to individual sites to change their settings (there’s no button to apply changes to all sites in the network yet). But some settings, such as cache, module, logs are only available to super admin and they are set network-wide, i.e. you don’t have to change them for individual sites.

        About your subdomain,, I can’t even access it, are you sure it is installed?

        • User's Gravatar
          Nat Colley May 3, 2011 at 4:46 pm – Permalink

          The subdomain has a dns problem with my host should be fixing right now.

          Google webmaster has happily accepted your sitemap so I went ahead and installed it on my production server even though I wasn’t sure I’d ever have any control over it – and maybe I never will need to? I will check out what you say when I set up subdomains on production, or maybe this morning on test if that gets fixed. But you still say there are some settings that are network wide, so how do I access them? Through the plugin editor?

          Thanks for the fast response, btw.

          • User's Gravatar
            OddOneOut May 3, 2011 at 4:53 pm – Permalink

            Through your primary site, that is :). Choose Sites on Menu, hover on the first (primary) site, and then click on Dashboard to visit the admin area for your primary site. Or, a faster way:

  8. User's Gravatar
    Nat Colley May 3, 2011 at 5:24 pm – Permalink

    Ok, I see it now. Thanks for your help and your plugin!

  9. User's Gravatar
    Sanam May 5, 2011 at 3:04 am – Permalink

    I have summited my site-map to Google around 02 hour ago. Now I got around 35,000 post in my website whereas in Google webmaster site-map submission shows only 4003. What about rest of the posts.?
    As you are saying in description that plugin will split site-map as per allotted no of post in setting by user and the same will be visible in webmaster site -map section. I am seeing nothing in my web master.
    Allowing Google to look for category and tags archive – I guess not good for seo. because Google hated to look same content again and again, arranged in multiple folder.
    Why Type is index not sitemap?
    If you answer my question I shall be very grateful to you. Thanks

    • User's Gravatar
      OddOneOut May 5, 2011 at 9:18 am – Permalink

      Hi Sanam,

      I have submitted my site-map to Google around 02 hour ago. Now I got around 35,000 post in my website whereas in Google webmaster site-map submission shows only 4003. What about rest of the posts.?

      Since you have deactivated the plugin, I can’t see what’s happening here.

      As you are saying in description that plugin will split site-map as per allotted no of post in setting by user and the same will be visible in webmaster site -map section. I am seeing nothing in my web master.

      I’m not entirely sure what you mean here. The sitemapindex will have child sitemaps and they are all visible inside webmaster tool. The Sitemap Statistics page will tell you which sitemaps you have.

      Allowing Google to look for category and tags archive – I guess not good for seo. because Google hated to look same content again and again, arranged in multiple folder.
      Why Type is index not sitemap?

      Sitemap is not meant to be crawled for contents, it simply allows Google to easily discover and follow links on your website. Google only indexes things that you allow it to index, so having archive sitemaps is not a problem. If you don’t like them you can disable them, right :)?

      Sitemapindex is more customizable and allows you to bypass the 50,000 URLs limit. A single sitemap is limited and is slower to build because you have to get everything in one run, whereas each sitemap in a sitemapindex is requested and then built independently, using its own module. That’s why I choose to use sitemapindex, and I think it’s much better.

      • User's Gravatar
        Sanam May 5, 2011 at 10:56 am – Permalink

        Thanks for prompt response. You can review my website sitemap at
        I have set max 5000 post in one sitemap.
        As I told you that I got 35000 posts that means
        35000/5000 = 7 (sub/child)sitemap should be visible in Google webmaster.
        In my webmaster has two sitemap
        >> post.xml
        >> page.xml
        post.xml showing 8000 post
        Page.xml showing 3 page
        As I have earlier stated that I got 35000 posts – so against 35000 posts – plugin has submitted only 8000 post to Google.
        issue no 1 > what about rest 27000 posts ?
        issue no 2 > 8000 post should not be showing in one sitemap since I have set 5000 max posts in one sitemap ?

        • User's Gravatar
          OddOneOut May 5, 2011 at 11:48 am – Permalink

          The ‘item limit’ option doesn’t work that way, it simply tells the generator to stop generating items when such limit is reached. I guess that you also set your own SQL Cycling limit? So, both issues you are having are expected.

          To have 7 child sitemaps the way you want, you must develop your own sitemapindex module (sitemapindex.php). To know how to develop such module, please refer to the documentation (see the Table of Contents). I suggest that you create another sitemapindex.php and put it in your custom module folder and then build something like post_sitemap_part1.xml, post_sitemap_part2.xml, etc., each will have 5000 items.

          In case you find it’s hard to develop one, I can help you, but I don’ think I can do it for free (at least now), because currently my time is very limited. If you can wait for about a week, I can happily build a custom module for you free of charge, or even include such module in the next release of this plugin.

  10. User's Gravatar
    Chris Toppon May 9, 2011 at 5:28 am – Permalink


    This is a great plugin! Here is something that might be useful for anyone using it with the Quick Cache plugin installed – you will need arrange for the sitemaps not to be cached by Quick Cache, otherwise Google will not accept the sitemap and return with the error: “General HTTP error: Couldn’t parse HTTP response”.

    To do that, in Quick Cache’s ‘No cache URI patterns’ in settings add each sitemap to the list of uri’s not to cache e.g.:
    … + any other sitemaps generated (custom post types, taxonomies etc)

    • User's Gravatar
      OddOneOut May 9, 2011 at 9:28 am – Permalink

      Actually, I have already mentioned this in the FAQ but not about Quick Cache, though. I will see if this can be built into the plugin so people won’t have to do this. And btw, you only need .xml I think ;).

      Anyway, thank you a lot for the contribution Chris!

      • User's Gravatar
        Chris Toppon May 9, 2011 at 5:06 pm – Permalink

        Ahh – I read the title: ‘Q: All I have is a white page and nothing else?’ and didn’t read further because with Quick Cache the xml sitemap is generated without issue – the only problem came when submitting to Google. Thanks again!

  11. User's Gravatar
    horation May 18, 2011 at 2:20 am – Permalink

    Hi, superb plugin, very resource-friendly. Question… I am running WPMU with domain mapping so that /site1/ maps to and /site2/ maps to How can Better WordPress Google XML Sitemaps be configured so that site1’s sitemap has URLs like and site2’s sitemap has URLs like thanks!

    • User's Gravatar
      OddOneOut May 18, 2011 at 2:17 pm – Permalink

      Hi horation,

      Did you mean post.xml or post1.html? I have not tested any domain mapping plugin but I’m pretty sure BWP GXS is not currently compatible with them because they seem to store their own mapping data somewhere else and I need some API functions to get them to work with my plugin. I will implement such enhancement in the next major release, just wait :).

      And btw, you are using WPMU, not Multi-site? It is working for you on WPMU? That’s great!

      • User's Gravatar
        horation May 18, 2011 at 10:33 pm – Permalink

        Yes, meant post1.xml

        This is on a WPMU site with multiple domain mapping. It mostly works. Problem – have not been able to get it to work on a site with 58K posts. Goes to a blank page. But an 8K posts site generates the XML map fine, and is correctly listed with the proper domains.

  12. User's Gravatar
    horation May 18, 2011 at 2:51 am – Permalink

    Related question on schedule generation. Some sitemap plugins generate sitemaps on a fixed schedule. Some generate sitemaps every time a new post is added. This BWP Google XML Sitemaps appears to generate only when a sitemap is pulled (by human or robot), and only generated if the cached one has not expired. Is that correct? thanks

    • User's Gravatar
      OddOneOut May 18, 2011 at 2:23 pm – Permalink

      You are absolutely correct. Why bother re-generating a sitemap if it is not being requested? Make sure you enable pinging, though, to let search engines know that you have fresh contents :).

      and only generated if the cached one has not expired

      if the cached one has expired.

  13. User's Gravatar
    Jacqui May 24, 2011 at 7:29 pm – Permalink

    When adding a page using “Page links to” plugin which has a permanent redirect set up leading to an external domain (i.e. my Twitter account) – how to I remove this from the page sitemap? At the moment there is a 404 crawl error for the page. Thanks.

    • User's Gravatar
      OddOneOut May 25, 2011 at 11:08 am – Permalink

      Hi Jacqui,

      You mean you have a page like and instead of a 301 HTTP status, Google reports a 404 one? That’s weird, or you mean you have 404 with page.xml?

      Currently, to exclude a page from the page sitemap you will have to create a custom page module and place it in a custom module folder (you can specify one in your admin page). Just copy page.php from bwp-google-xml-sitemaps/includes/modules/ and change the SQL query to ignore certain pages. I would do it like this:

      In page.php, change this:

      		$latest_post_query = '
      				SELECT * FROM ' . $wpdb->posts . "
      					WHERE post_status = 'publish' AND post_type = 'page'" . '
      				ORDER BY post_modified DESC';

      to this:

      		$latest_post_query = '
      				SELECT * FROM ' . $wpdb->posts . "
      					WHERE post_status = 'publish' AND post_type = 'page'
      					AND post_name NOT IN ('slug1', 'slug2', 'slug3')" . '
      				ORDER BY post_modified DESC';

      Hope that works for you :).

— Comments are closed.

Next Post: