WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
XML sitemap with wrong date format (31 posts)

  1. drosolen
    Member
    Posted 2 years ago #

    Hi
    the sitemap_index http://something/sitemap_index.xml shows wrong datas:
    Sitemap Last Modified
    http://something/post-sitemap1.xml -001-11-30 00:00
    http://something/post-sitemap2.xml -001-11-30 00:00
    http://something/post-sitemap3.xml 2010-08-09 11:06
    http://something/post-sitemap4.xml 2010-12-29 13:23

    then google webmaster tools doesn't accept it.
    Could someone help me to understand what happens?
    thanks in advance
    D

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

  2. mefta
    Member
    Posted 2 years ago #

    Hi, I have the same invalid date problem through the SEO plugin by Yoast. Where you able to fix it? If so, kindly explain how. Thanks.

  3. Dutchintouch
    Member
    Posted 1 year ago #

    Was a solution found for this issue? One of my site has 27 sitemaps, 15 of which have the -001-11-30 00:00 last modified date.

    WordPress: 3.5.1
    Yoast SEO: 1.4.7

  4. mefta
    Member
    Posted 1 year ago #

    Using the sitemap plugin from http://wordpress.org/extend/plugins/google-sitemap-generator/ and disabling the Yoast sitemap generator was the only viable stop-gap measure that worked for me.

  5. jayo
    Member
    Posted 1 year ago #

    Anyone found a solution?

  6. alpineace@alpineace.com
    Member
    Posted 1 year ago #

    I deleted the main sitemap_index.xml from webmaster tools and submitted all of the individual sub sitemaps. The sub sitemaps returned no errors. It will do until a solution is found.

  7. jayo
    Member
    Posted 1 year ago #

    ^^ thnx for the info. Hopefully a simplier solution will be found soon

  8. pwizard
    Member
    Posted 1 year ago #

    A lot of discussion on this today. Can this be a result of wordpress 3.5.2?

  9. coralseait
    Member
    Posted 1 year ago #

    Possible, I believe I've found the offending issue with my sitemap.

    The category timestamp is different than the others

    <sitemap>
    <loc>http://www.coralseait.com/attachment-sitemap.xml</loc>
    <lastmod>2013-06-22T00:58:11+00:00</lastmod>
    </sitemap>
    <sitemap>
    <loc>http://www.coralseait.com/category-sitemap.xml</loc>
    <lastmod>2013-06-23 13:04:02</lastmod>
    </sitemap>
    <sitemap>

    Notice the different format, and this is indeed the line google complains about. I tried updating a category to force a new timestamp which did happen, but still in the wrong format.

  10. jayo
    Member
    Posted 1 year ago #

    ^^ yea saw that. Not sure how to modify code to fix tho

  11. astrasuite
    Member
    Posted 1 year ago #

    Not a good thing, I like Yoast's Sitemap generator. I use 3.5.2 and the previous version of Yoast SEO, and it works great, that's my solution :-). The old one ain't broke.

    I'll only upgrade to the latest Yoast once this issue is fixed, and something about titles I saw in another post ...

  12. jayo
    Member
    Posted 1 year ago #

    ^^ which version you using? The previous one seems like, the XML map is broken.

  13. astrasuite
    Member
    Posted 1 year ago #

    I use 1.4.7, perfect sitemap, well-indexed by Google, no errors at all. Same with Bing.

    Sitemap index
    Jun 22, 2013
    -
    Web
    388 submitted
    350 indexed
    Images
    1,480 submitted
    1,284 indexed

  14. acuraz.net
    Member
    Posted 1 year ago #

    It appears 1.4.10 contains a few changes in xml-sitemaps.php

    Since these changes, the sitemap will be generated with an incorrect date format.

    I have the same issue and hopefully the dev will fix it soon.

    Take a look at : http://plugins.trac.wordpress.org/changeset/729601/wordpress-seo/trunk/admin/pages/xml-sitemaps.php?old=729023&old_path=wordpress-seo%2Ftrunk%2Fadmin%2Fpages%2Fxml-sitemaps.php

  15. roaming_elephants
    Member
    Posted 1 year ago #

    Without knowing much about php, I think I have managed to narrow down the problem to date format with custom taxonomies.

    To sort out the issue (which worked for me), the following lines should be edited in wordpress-seo/inc/class-sitemaps.php file:

    Line 249 and 250, which currently read:

    if ( $query->have_posts() )
    	$date = $query->posts[0]->post_modified_gmt;

    Should be changed to:

    if ( $query->have_posts() ) {
      $date = $query->posts[0]->post_modified_gmt;
      $date = date( 'c', strtotime( $date ));
    }

    This puts the date in correct format. As I said, it worked for me.
    Bare in mind that I am not a programmer, but just a man with a lot of persistence. I'm not sure how the above edit affects the rest of the file - it shouldn't affect it adversely.

    Good luck!

    http://atifabusamra.com

  16. Jan
    Member
    Posted 1 year ago #

    The sitemaps at the lower level, like ".../page-sitemap.xml" have no faults. The top level one ".../sitemap_index.xml" has a problem with an invalid data.

    In Dutch (i'm sorry guys) the index error is:

    Bovenliggende tag: sitemap
    Tag: lastmod
    Waarde: 2013-06-23 17:43:46

    I have a new site, so indexing should hopefully happen for me. If not it's probably because of this index error.

    Hope it is solved soon. I love the plugin.

  17. roaming_elephants
    Member
    Posted 1 year ago #

    Hi Jan,

    Has the solution above not worked for you?

  18. Jan
    Member
    Posted 1 year ago #

    Tried it, the errors are gone.

    But this means editing in an original source file. For now the error are gone, but the issue is still open and to be solved. :)

    Thanks for the code.

  19. roaming_elephants
    Member
    Posted 1 year ago #

    No probs. Thanks.
    Just wanted to know if it worked for anyone else.
    I'm sure by the next update they will have fixed the bug.
    Cheerio!

  20. jayo
    Member
    Posted 1 year ago #

    Hey Roaning Elepants...

    Does the trailing "}" in your code, replace the one that wasn't included in the original code?

    In your original code, it doesnt show the trailing "}", but has it in the actual code, which you include in the replacement code.

    Did I make any sense? lol

    Meaning replace this original code:

    if ( $query->have_posts() )
     $date = $query->posts[0]->post_modified_gmt;
    
    }

    With this replacement:

    if ( $query->have_posts() ) {
      $date = $query->posts[0]->post_modified_gmt;
      $date = date( 'c', strtotime( $date ));
    }
  21. roaming_elephants
    Member
    Posted 1 year ago #

    Hi Jayo,

    No, the trailing "}" is to close the opening "{" which was added at the end of first line. If you have a closer look at the original code, you'll observe that there is no "{" or "}". I've introduced a new line within the "if" statement and thought I should wrap it within curly brackets.

    In your post, what you've quoted as the "original code" is not the original code. The original code does not have the trailing "}".

    Hope that makes sense?

  22. jayo
    Member
    Posted 1 year ago #

    Ok sorry, I get what you're saying. Didn't noticed the opening "{" that was added.

  23. Gautam Thapar
    Member
    Posted 1 year ago #

    @roaming_elephants your code does work, thanks and cheers!

  24. mAsT3RpEE
    Member
    Posted 1 year ago #

    Another tip is to disable then enable sitemaps. Especially after an upgrade. I haven't changed any code from 1.4.10. Works fine for me.

  25. Pedro
    Member
    Posted 1 year ago #

    @roaming_elephants thanks for the fix, it works like a charm!

    I had the secondary error:

    An invalid date was found. Please fix the date or formatting before resubmitting.

    Thanks again!

  26. pwizard
    Member
    Posted 1 year ago #

    Anyone know if the developers are on this?

  27. coralseait
    Member
    Posted 1 year ago #

    Yoast will probably fix it in the next release. I'm not sure it is really causing problems with google as it seems to be processing the child xml maps ok but I won't know until next full crawl.

  28. GideonLupine
    Member
    Posted 1 year ago #

    I made the edit and it worked for me.

  29. M
    Member
    Posted 1 year ago #

    Jayo, same problem with date here too. Applied your fix now and waiting for Google Webmasters to update the sitemap. If it does work (which I expect) you should send the fix to Yoast plugin developer.

    Thanks for looking into this.

  30. petervanderdoes
    Member
    Posted 1 year ago #

    Fixed in version 1.4.11

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic