WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] Google Webmaster cannot find sitemap (19 posts)

  1. trustedsamurai
    Member
    Posted 1 year ago #

    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/

  2. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

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

  3. trustedsamurai
    Member
    Posted 1 year ago #

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

  4. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    Good to hear that!

  5. germanliu
    Member
    Posted 1 year ago #

    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?

  6. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    It works fine as far as i can see.

  7. germanliu
    Member
    Posted 1 year ago #

    For me too... but not for google's webmaster tools

  8. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    Did it re-fetch it?

  9. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

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

  10. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    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!

  11. germanliu
    Member
    Posted 1 year ago #

    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

  12. j_schumann
    Member
    Posted 1 year ago #

    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

  13. JochenT
    Member
    Posted 1 year ago #

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

  14. j_schumann
    Member
    Posted 1 year ago #

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

  15. JochenT
    Member
    Posted 1 year ago #

    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.

  16. JochenT
    Member
    Posted 1 year ago #


  17. JochenT
    Member
    Posted 1 year ago #

    The bug fix of Joost to add header( 'HTTP/1.1 200 OK' ); seems not to be a solution. Also to remove only this single header line as posted in http://wordpress.org/support/topic/patch-included-sitemaps-xml-parser-complains-about-invalid-characters did not help me.

    Removing all header() calls in that function did solve the problem. As there are other posts which complain about problems with "headers already sent" errors, I suspect there is somewhere or sometimes HTML output in the plugin in before.

  18. j_schumann
    Member
    Posted 1 year ago #

    I think the target should be to prevent the 404 in the first place instead of overwriting it later as this seems too dependent on the environment. http://www.php.net/manual/en/function.header.php mentions a different notation for FastCGI in the parameter description.

  19. JochenT
    Member
    Posted 1 year ago #

    I could create a reproducable error behaviour with sitemaps.

    See post http://wordpress.org/support/topic/sitemap-fails-only-after-reenabling-seo-plugin.

    Removing all headers in function output() did not solve the problem anyway.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags