WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] XML Sitemap Error: "sitemap_index is not a valid feed template (16 posts)

  1. ASBC
    Member
    Posted 2 years ago #

    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

    cheers

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. ispreview
    Member
    Posted 2 years ago #

    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.

    http://yoast.com/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.

  3. tresero
    Member
    Posted 2 years ago #

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

  4. JPS Autosport
    Member
    Posted 2 years ago #

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

  5. pixelyzed
    Member
    Posted 2 years ago #

    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.

  6. pixelyzed
    Member
    Posted 2 years ago #

    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.

  7. ispreview
    Member
    Posted 2 years ago #

    Which plugin function was it found in pixel?

  8. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

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

  9. ispreview
    Member
    Posted 2 years ago #

    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.

  10. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  11. pixelyzed
    Member
    Posted 2 years ago #

    Hello Joost,

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

    http://wordpress.org/extend/plugins/diamond-multisite-widgets/

    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).

    Thanks!

  12. ispreview
    Member
    Posted 2 years ago #

    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.

  13. ispreview
    Member
    Posted 2 years ago #

    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):

    http://www.ispreview.co.uk/index.php/sitemap_index.xml

    But instead it plopped it here:

    http://www.ispreview.co.uk/sitemap_index.xml

    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 :) .

  14. Swashata Ghosh
    Member
    Posted 2 years ago #

    Hello,
    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!

  15. ispreview
    Member
    Posted 2 years ago #

    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.

  16. Swashata Ghosh
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic