Support » Plugin: Yoast SEO » [Plugin: WordPress SEO by Yoast] Google Webmaster cannot find sitemap

  • Resolved John Anderson

    (@trustedsamuri)


    WordPress: 3.3.2
    Yoast SEO: 1.1.9

    Since upgrading to Yoast, I’ve noticed that my sitemap.xml file has disappeared. Google webmaster brought this to my attention.

    Yoast SEO says my sitemap is called sitemap_index.xml but a) this file does not exist in the root and b) even if it did, Google is looking for sitemap.xml not sitemap_index.xml

    I copied an older version of sitemap.xml (off my local machine) into the root and Google Webmaster found it straight away. I am sure this older version of sitemap.xml was created by Yoast SEO.

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

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Joost de Valk

    (@joostdevalk)

    The XML sitemap process in the plugin changed. The main sitemap can now be found at /sitemap_index.xml, which you’ll also find in Google Webmaster Tools under “other”.

    John Anderson

    (@trustedsamuri)

    I could not find ‘other’ on google webmaster but was able to submit sitemap_index.xml successfully.

    Plugin Author Joost de Valk

    (@joostdevalk)

    Good to hear that!

    Hi, I am trying to submit my sitemap to google webmaster tools but a General HTTP error: 404 not found HTTP Error: 404 appears. If I check my sitemap url I can see it: http://ritzycharters.com/sitemap_index.xml

    any suggestion?

    Plugin Author Joost de Valk

    (@joostdevalk)

    It works fine as far as i can see.

    For me too… but not for google’s webmaster tools

    Plugin Author Joost de Valk

    (@joostdevalk)

    Did it re-fetch it?

    Plugin Author Joost de Valk

    (@joostdevalk)

    Ah. Found it. Somehow it’s throwing a 404 AND showing the output.

    Plugin Author Joost de Valk

    (@joostdevalk)

    Could you open the following file:

    /wordpress-seo/inc/class-sitemaps.php

    then find this line:

    function output() {

    and add this immediately after it:

    header( 'HTTP/1.1 200 OK' );

    this might fix it, please let me know if it does!

    Joost, it worked! Thank you very much. Would you include this in next update? If not I will loose it.

    For everyone else, I ALSO added the following to the .htacces:

    # WordPress SEO – XML Sitemap Rewrite Fix
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^sitemap_index\.xml$ /index.php?sitemap=1 [L]
    RewriteRule ^([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
    </IfModule>
    # END WordPress SEO – XML Sitemap Rewrite Fix

    This fix, included in version 1.2.6, breaks the sitemaps for our environment (Nginx as loadbalancer talking only HTTP 1.0 to it’s Apache backends), the output has 4 hexdigits added before the content so XML parsing fails.

    I also don’t think it’s save to assume all other environments use HTTP 1.1

    See http://www.php.net/manual/de/function.header.php#92305 for a similar error report.

    I think using
    header(“Status: 200”, true);
    should be fine.

    Else try
    header($_SERVER[‘SERVER_PROTOCOL’].’ 200 OK’, true);
    but I’m not sure if this variable is set on all webservers, so this should be used after checking the existence and maybe having 1.0 as fallback:
    $proto = isset($_SERVER[‘SERVER_PROTOCOL’]) ? $_SERVER[‘SERVER_PROTOCOL’] : ‘HTTP/1.0’;
    header($proto.’ 200 OK’, true);

    Best regards, hoping to see this fixed in the next version,
    J.Schumann

    @j_schumann: I’ve implemented both of your suggestions but did not succeed.

    But when I unchecked the boxes to ping Yahoo! & Ask.com the sitemap was displayed properly.

    The site is running on a multiserver environment with loadbalancer. The backend servers are running with fastcgi.

    Did it work with the original version implemented in WP SEO? If not, does it work with the header() function completely commented out? For me it works with no header() at all as well as with header(“Status: 200”, true);

    It did not work with the original version. Avoiding all headers did work. At least the xml content was sent.

    But reverting to the original file version after the test did result in a strange behaviour. Again I got a 404 for sitemap_index.xml. But now checking the boxes to ping Yahoo! & Ask.com to ON did bring back the sitemap.

    There seem to be a strange interference between these two functionalities.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] Google Webmaster cannot find sitemap’ is closed to new replies.