Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • You get the 404 error when the post-sitemap.xml / page-sitemap.xml is empty.

    Maybe this will help :

    I had Post and Page missing in post-sitemap.xml / page-sitemap.xml. It was the Post/Page having the options “Include in Sitemap” is set to “Auto detect” AND “Meta Robots Index” is set to “Index”

    You may change your post/page options this way :
    “Include in Sitemap” set to “Always include” should work.
    or
    “Meta Robots Index” set to “Default for Post type, currently : Index” should work too.

    If you don’t want to change all posts/pages you can modify the plugin file inc/class-sitemaps.php : what works for me is changing the line 326 for the plugin version 1.3.4.4 (line 325 for the plugin version 1.4.4)
    from
    if ( wpseo_get_value( 'meta-robots-noindex', $p->ID ) && wpseo_get_value( 'sitemap-include', $p->ID ) != 'always' )
    to
    if ( wpseo_get_value( 'meta-robots-noindex', $p->ID ) == 1 && wpseo_get_value( 'sitemap-include', $p->ID ) != 'always' )

    I have Post and Page missing when the option “Include in Sitemap” is set to “Auto detect” AND “Meta Robots Index” is set to “Index”

    You may change your post/page options this way :
    “Include in Sitemap” set to “Always include” should work.
    or
    “Meta Robots Index” set to “Default for Post type, currently : Index” should work too.

    If you don’t want to change all posts/pages you can modify the plugin file inc/class-sitemaps.php : what works for me is changing the line 326 for the plugin version 1.3.4.4 (line 325 for the plugin version 1.4.4)
    from
    if ( wpseo_get_value( 'meta-robots-noindex', $p->ID ) && wpseo_get_value( 'sitemap-include', $p->ID ) != 'always' )
    to
    if ( wpseo_get_value( 'meta-robots-noindex', $p->ID ) == 1 && wpseo_get_value( 'sitemap-include', $p->ID ) != 'always' )

    Thread Starter Hedi

    (@azepic)

    I have updated to wordpress-seo 1.4.1 but nothing changed, the problem remains :/

    Thread Starter Hedi

    (@azepic)

    1/ The page-sitemap generated is empty… And the plugin redirect to a 404 not found.
    I think one of these may be better when it’s empty :
    Not having page-sitemap in sitemap_index (keeps Not found error)
    or
    Having an empty page-sitemap (doesn’t seem the best idea ^^’)

    2/The page-sitemap generated empty shouldn’t be empty.
    For Post and Page : The error occurs when the option “Include in Sitemap” is to “Auto detect”, instead “Always include” should work.

    “Auto detect” works if in the advanced settings you have “Meta Robots Index” to “Default for Post type, currently : Index”

    If you have “Index” it doesn’t work.
    Seems like it’s in the file inc/class-sitemaps.php : what seems to work is changing the line 326
    from
    if ( wpseo_get_value( 'meta-robots-noindex', $p->ID ) && wpseo_get_value( 'sitemap-include', $p->ID ) != 'always' )
    to
    if ( wpseo_get_value( 'meta-robots-noindex', $p->ID ) == 1 && wpseo_get_value( 'sitemap-include', $p->ID ) != 'always' )

    Seems like 1 is NoIndex, 2 is Index and empty is default.

Viewing 4 replies - 1 through 4 (of 4 total)