Support » Plugin: Yoast SEO » [Plugin: WordPress SEO by Yoast] XML Sitemap Error: "sitemap_index is not a valid feed template

  • Resolved ASBC


    i can’t access my sitemap
    i get the following error: sitemap_index is not a valid feed template

    thinking this was a theme issue, i switched from PageLines Platform (free version) to Twenty Eleven…had the same problem

    WordPress SEO was working brilliantly last week. Since then, i installed a few plugins (a newsletter plugin, SEO Smart Links and nrelate)

    i’d appreciate any help


Viewing 15 replies - 1 through 15 (of 15 total)
  • I get the same problem and have my own custom theme, so the fix mentioned here doesn’t work as I don’t have that code.

    XML Sitemap in the WordPress SEO plugin

    I never see the sitemap files either but don’t know where they would be created? I get this with both pretty urls and pathinfo methods of permalinking. I’ve since stopped using .htaccess based pretty url’s though as they caused problems with my other redirects.

    I am having the same problem. Worked for a while and then quit.

    Dutch RC


    Same problem here,
    Use latest wordpress, latest WP Super Cache and latest WordPress SEO

    I’m getting the same problem on a multisite install with the latest WPSEO 1.2.2 and I’m not finding much info on Google.

    I found a blog article mentioning this line in old theme code causing this problem:

    ‘(.+).xml’ => ‘index.php?feed=’. $wp_rewrite->preg_index(1)

    I did a search on that code in my install and it was found in a plugin function. Commenting it out fixed the issue for me.

    Which plugin function was it found in pixel?

    Plugin Author Joost de Valk


    Yeah would love to know which plugin that was. It prevents a smack on the head for registering a rewrite like that.

    Ah.. think I know what he means.

    A lot of people have created custom RSS/Google News feeds to avoid heavy-handed plugins for the same task. The code most often shared and added into functions.php for it is this.

    function custom_feed_rewrite($wp_rewrite) {
     $feed_rules = array(
     'feed/(.+)' => 'index.php?feed=' . $wp_rewrite->preg_index(1),
     '(.+).xml' => 'index.php?feed='. $wp_rewrite->preg_index(1)
     $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
    add_filter('generate_rewrite_rules', 'custom_feed_rewrite');

    I’m not a natural PHP coder and so I’m not sure how to change this so that the SEO Sitemap works without breaking the equally vital custom feeds.

    Plugin Author Joost de Valk


    remove this bit:

    '(.+).xml' => 'index.php?feed='. $wp_rewrite->preg_index(1)

    it’s a blatant rewrite that catches every URL that ends in .xml, which is stupid.

    Hello Joost,

    The plugin that was causing the issue for me is Diamond Multisite Widget:

    I use it to pull links to the last few articles of selected blogs in the network. It actually does that quite well but has caused me other issues in the past.

    I’d gladly be rid of it if someone could recommend an alternative that does the same thing (or some code I could put in my theme’s functions.php file).


    Yeah removing that line worked and my other feeds remain ok since none of them end in .XML. Now I can generate your sitemap too.

    Been working fine, then today I upgraded to 1.2.3 and now the sitemap is no longer respecting WP’s permalink structure again.

    It should have generated the sitemap here (as per the plugin button):

    But instead it plopped it here:

    The internal sitemap archive links also still point to /index.php/ links but obviously the script can’t see this. I’ve disabled the sitemap for now.. well at least it worked for a few days 🙂 .

    I was having the same issue in a WP MS setup. I found that it was caused by the feed rewrite rule of Diamond Multisite widgets plugin. I simply disabled the class inside diamond-post-feed.php by commenting the line
    //$feedObj = new DiamondPF ();
    I did so because I do not need all community sites feed on my main site feed. Just posting this because someone might find this useful. Another way of doing it might be (havent tested) comment out line 13
    //'(.+).xml' => 'index.php?feed='. $wp_rewrite->preg_index(1)

    I didn’t do it because the plugin was breaking the feed anyway. So I had it disabled using the 1st trick 🙂

    Thanks Yoast for this wonderful plugin and nice FAQ page!

    Yes but I already did that, as per above, and got it working. But since 1.2.3 it has stopped working again despite a similar line in my functions.php having been removed.

    ispreview: I think going to your permalink settings page (Settings » Permalinks) will solve your problem

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] XML Sitemap Error: "sitemap_index is not a valid feed template’ is closed to new replies.