Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.77k stars 894 forks source link

Bug: post_status sitemap showing even though excluded from settings #1481

Closed zachary-russell closed 9 years ago

zachary-russell commented 10 years ago

I noticed earlier today that in Google WMT that I was getting errors for a post_status-sitemap.xml file. I knew that I excluded this from my site, yet when I went to sitemap_index, it indeed was there. When you click on the sitemap, however, it 404s. Everything on my site is up to date. It's hosted on WP Engine, and I did clear my caches and disiable/reenable the sitemap functionality just in case. Attaching screenshots. screen shot 2014-08-23 at 12 41 16 am screen shot 2014-08-23 at 12 41 25 am screen shot 2014-08-23 at 12 41 41 am

toddlahman commented 10 years ago

Here's a temporary fix. Add the following code to your theme's functions.php file:

function sitemap_exclude_taxonomy( $value, $taxonomy ) {
    if ( 'post_status' == $taxonomy ) {
        return true;
    }
}

add_filter( 'wpseo_sitemap_exclude_taxonomy', 'sitemap_exclude_taxonomy', 10, 2 );
Rarst commented 9 years ago

The question is what post_status exactly is? I don't think it is native WP element, any idea where is it coming from?

zachary-russell commented 9 years ago

@Rarst sorry for the lack of response here. In my case the problem resolved it self (obviously through a plugin update over the past year). I know of post_status only as it references to how a post is published https://codex.wordpress.org/Post_Status - though i'm sure you know what that is. Anyway, I don't think I can add any more value to this conversation - I really appreciate the follow up though!

Rarst commented 9 years ago

No worries, glad to hear it resolved. :) To be clear the core's native concept of post status is special thing, it shouldn't come up in sitemap like post type or taxonomy. My guess was something was creating taxonomy of that name or around that.

whyisjake commented 9 years ago

@protechig Are you using Edit Flow per chance?

zachary-russell commented 9 years ago

@whiskake I may have. I know I discussed using it with my business partner but I can't remember if I actually installed it (it was a year ago this issue was opened). The fact that you're asking about it means that I probably did and have since deleted it.

whyisjake commented 9 years ago

Yeah, we are using it at WIRED and have this same issue. They added a custom taxonomy for created/editing post stati.

zachary-russell commented 9 years ago

@whyisjake must be fun. I'm a technical SEO as well as a WP developer so I know from experience those errors I WMT can be disconcerting. Though you're not really having any true errors once that page shouldn't be crawled anyway.

Have you summits yes this issue with Edit Flow the ?

Rarst commented 9 years ago

@whyisjake could you consider opening new issue with all the details of your case please? :) Not at all sure it's a same one and OP has had it resolved.