WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] Invalid date in sitemaps (17 posts)

  1. petervanderdoes
    Member
    Posted 9 months ago #

    WordPress version: 3.5.1
    WordPress SEO version: 1.4.9

    The categories loc has a wrong format of the lastmod date. Both standard and custom posts categories.

    <sitemap>
    <loc>http://www.foo.com/event-sitemap.xml</loc>
    <lastmod>2013-06-06T00:47:57+00:00</lastmod>
    </sitemap>
    <sitemap>
    <loc>http://www.foo.com/category-sitemap.xml</loc>
    <lastmod>2013-06-21 03:10:14</lastmod>
    </sitemap>
    <sitemap>
    <loc>http://www.foo.com/event-categories-sitemap.xml</loc>
    <lastmod>2013-06-06 00:47:57</lastmod>
    </sitemap>
    <sitemap>
    <loc>http://www.foo.com/author-sitemap.xml</loc>
    <lastmod>2013-06-21T10:37:38+00:00</lastmod>
    </sitemap>

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

  2. petervanderdoes
    Member
    Posted 9 months ago #

    It's not just categories, just checked the code, it's all taxonomies. I just don't have tags on my site.

    I also believe the date will be wrong if you limit the amount of entries and the entry is hit, or you just have one post

    From the code lines 187-189 in class-sitemaps.php:

    if ( empty( $count ) || $count == $n ) {
    	$date = $this->get_last_modified( $post_type );
    } else {

    A solution is to move line 191

    $date = date( 'c', strtotime( $date ) );

    below line 192.

  3. jayo
    Member
    Posted 9 months ago #

    Tried this... didnt seem to work.

    Any other suggestions?

  4. petervanderdoes
    Member
    Posted 9 months ago #

    Instead of moving the line, copy that line below line 188.

  5. jayo
    Member
    Posted 9 months ago #

    Thanks Peter, getting same result...

    Errors when I test in Google webmaster tools.

  6. mdidesign
    Member
    Posted 9 months ago #

    Any news? I have the same problem. The tags in the sitemap show up wrong lastmod dates. The "T" is missing. This should be fixed. Webmaster Tools is reportimg issues.

  7. petervanderdoes
    Member
    Posted 9 months ago #

    I haven't heard anything, not seen any update.

    SEO Version: 1.4.10

  8. petervanderdoes
    Member
    Posted 9 months ago #

    Add this

    $date = date( 'c', strtotime( $date ) );

    Before line 259

    $this->sitemap .= '<sitemap>' . "\n";
  9. mdidesign
    Member
    Posted 9 months ago #

    I will try that out. I do not understand why Yoast dors not fix that issue.

  10. Marcelo Pedra
    Member
    Posted 9 months ago #

    Hello guys, I've detected the same issue from a Google Webmasters alert. The dates are bad formatted for taxonomies other than post or pages. It's simply a typo error in the code. Hope this may be fixed soon since it's a easy to fix glitch.

  11. elovkoff
    Member
    Posted 9 months ago #

    Same here. I excluded taxonomies from SEO - hence no errors :)
    It seems like Yoast is not really a frequent guest here unfortunately...

  12. Marcelo Pedra
    Member
    Posted 9 months ago #

    Yoast is reading this, you can be sure ;)

  13. astrasuite
    Member
    Posted 9 months ago #

    Well, hope he fixes it soon, as it is an important function, same with the one whose issue was additional text in the title, and whatever is there that may affect SEO (the main reason we use this plugin) ...

    Then maybe I can upgrade to the new version :)

  14. petervanderdoes
    Member
    Posted 9 months ago #

    Forgetting an entire function call is not a typo as far as I'm considered.

    And for others reading this, you have to do both code changes, http://wordpress.org/support/topic/invalid-date-in-sitemaps?replies=11#post-4333053 and http://wordpress.org/support/topic/invalid-date-in-sitemaps?replies=11#post-4345799

    The next release of the plugin will fix this, the fixes are implemented in the github repository.

  15. hovida
    Member
    Posted 9 months ago #

    After the Update of 1.4.11 the WMT give me a 404 Error for the sitemaps.

  16. petervanderdoes
    Member
    Posted 9 months ago #

    @hovida I don't have that problem and the problem isn't related to this original problem of this thread. Please start a new thread

  17. Howard
    Member
    Posted 9 months ago #

    @petervanderdoes, thanks for debugging this issue!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.