Wordpress-seo: Author-sitemap give 404

Created on 29 Dec 2016  ·  46Comments  ·  Source: Yoast/wordpress-seo

I expect that enabling user sitemap it would automatically create a new xml with users page links

The index updates, but author sitemap is a 404

I don't know how to help you reproduce the behavior but I can provide you all the information you require

  • WordPress version: 4.7 “Vaughan”
  • Yoast SEO version: 4.0.2
compatibility xml sitemap help wanted

Most helpful comment

That might have done away with the problem for you @roccomarco but that didn't fix the issue :-)

All 46 comments

Thanks for reporting this issue. Could you please save your permalinks again? It could be that the settings are not properly saved. The steps to do this, are:
Go to WordPress ‘Settings’ in the backend
Go to ‘Permalinks’
Click ‘Save Changes’ (without altering anything)

Could you inform me if this solves your issue?

It's weird, but it's possible conflict with other plugins. I see multiple authors per post. Could you provide more details about other related plugins? ( Maybe Co-Author plus or ...)
It seems that you have installed polylang. Could you confirm it?

I don't remember all details but it's possible that Co-Auhor plus uses meta fields. Yoast SEO uses database query. Please provide more details and I'll try to help.

PS. I think that permalinks are fine, because you can open other sitemaps.

@CarolineGeven doesn't work. Already read your throubleshoot

@stodorovic I have both Polylang and Co-Author plus

Ok, disabled Co-Author Plus and it works. How to solve this incompatibility?

Thanks for the update, @RoccoMarco! We'll discuss this issue internally to check if this is a bug on our end or by co-author plus.

I unfortunately cannot say when we are able to get back to you. Currently we're focusing on issues that affect many users. As this issue is not experienced by many users, we're not able to look at this short-term. However, if more users are affected by this bug, we'll of course revisit this issue.

Additionally, we'd advise you to inform co-author plus of this issue as well.

For your info I am disabling user sitemap. Let me know if you need more info

@RoccoMarco I'll try to reproduce it later. I think that know what's wrong, but it's hard to say how to fix it.

Similar issue #5061

I've found reason why author-sitemap.xml returns 404. Co-Authors plus plugin uses following code to create custom taxonomy:

// Name for the taxonomy we're using to store relationships
// and the post type we're using to store co-authors
var $coauthor_taxonomy = 'author';

...
register_taxonomy( $this->coauthor_taxonomy, $this->supported_post_types, $args );

From other side, Yoast checks WPSEO_Taxonomy_Sitemap_Provider before WPSEO_Author_Sitemap_Provider, but taxonomy_exists( 'author' ) is true, it's private taxonomy and Yoast SEO returns 404.

https://github.com/Yoast/wordpress-seo/blob/trunk/inc/sitemaps/class-sitemaps.php#L80-L84
https://github.com/Yoast/wordpress-seo/blob/trunk/inc/sitemaps/class-taxonomy-sitemap-provider.php#L165-L167

The simplest solution is to we change order of providers. I created pull request #6345

Other issue, author sitemap runs wp query, so option "users without posts" is excluding coauthors if they aren't authors for any post. It's issue related to Co-Authors plus, but it isn't too important.

I didn't yet test possible issues related to Yoast SEO, Polylang and Co-Authors plus. I see that Polylang supports more "Biographical Info" per auhor. I'll try it, but I'm not sure that's possible to we include all languages in author sitemap. (I think that works only for default)

@stodorovic Thanks for diving deeper into this issue. However, please do not advise users to replace files. With a new update, the file will again be replaced and we will not be able to maintain or pinpoint any issues coming from custom code.

If your solution is a fix for this bug, I kindly request you to open a pull request so we can code review the code and possibly add it to the plugin.

@CarolineGeven Thanks for advice. You are right.

@CarolineGeven I have tested the edit. It works. I hope you will approve the pull request.

@stodorovic Thanks for the PR and @RoccoMarco thanks for testing it! It's much appreciated.

I've added the PR to our work flow where it'll be checked and tested on our systems as well.

It's related to #6354

After internally discussing this issue, we've decided to temporarily put this issue on 'needs decision'. As @andizer pointed out in #6345, the issue is a bit more complicated than we anticipated.

The bug itself is fixed with a reorder of the code. However, as pointed out internally, it might break more that we can anticipate on right now. We suspect there's something more underlying. We'll discuss this issue internally and will take a decision. We'll get back to you as soon as possible.

Approach to solution

If we prefix taxonomies and custom post types we will avoid overlapping names.
For taxonomies: taxonomy-{taxonomy_name}-sitemap
For custom post types: cpt-{post_type}-sitemap

We still want to use the base name for

  • WordPress default post type sitemaps
  • Author sitemaps

Please inform the customer of conversation # 179953 when this conversation has been closed.

So what about this fix? I have to edit code in the plugin folder and suspend update.

@RoccoMarco I apologize for not getting back to you sooner. The easiest fix for you would be to fix it locally. However, we advise you to update, as outdated code can make your website more vulnerable.

Currently we're focusing on issues that affect many users. We've concluded that this issue is not experienced by many users, therefore we are not able to fix this short-term. However, if more users are affected by this bug, we'll of course revisit this issue. If someone were to write a patch for this with the proposed solution @moorscode suggested above, we will of course take a look at it and consider the fix.

Thanks. I have fixed it locally but it is a mess everytime I have to
update. I will take a look to other plugins too.

We are experiencing 404 errors on our author sitemaps as well. We are using coauthors plus plugin for our scholar pages, and here is an example sitemap: http://www.aei.org/guest-author-sitemap1.xml. The sitemap does not show our scholar permalinks, but default Wordpress URLs. When we click on any of the Wordpress URLs in the sitemap, it goes to our 404 page. This is causing issues with Google not indexing our scholar pages properly. We have tried resaving our permalinks.

Example of a scholar URL on our website that should be indexed: http://www.aei.org/scholar/arthur-c-brooks/

Please inform the customer of conversation # 239222 when this conversation has been closed.

We are seeing this too at washingtonian.com.

Please inform the customer of conversation # 297457 when this conversation has been closed.

Please inform the customer of conversation # 311221 when this conversation has been closed.

Any news about this issue? we also have the same problem with yoast + co-authors-plus

@ptravassos We've been able to reproduce the issue and have therefore labeled the issue as a bug.

Unfortunately we're not able to fix this at short notice. Currently we're focusing on issues that affect many users. We've concluded that this issue is not experienced by many users, therefore we are not able to fix this short-term. However, if more users are affected by this bug, we'll of course revisit this issue.

Co-Authors is a pretty widely used plugin. It seems possible people are experiencing it but don't know it's even happening. I had assumed everything was working per usual, and only happened to check.

I am seeing this issue as well. +1 on shipping a fix.

The real solution here is to rename our sitemaps and prefix them properly. Unfortunately, that's a bit of work. We're going to take that work on when we redo XML sitemaps logic based on our new ORM, which means I'm going to label this as such and park it for now.

Coming here after one year. I have definitely solved this issue one year ago

  • go into the plugin menu
  • find Yoast Seo
  • select Deactivate
  • select Uninstall

Done!

That might have done away with the problem for you @roccomarco but that didn't fix the issue :-)

I just got contacted by Yoast support saying that they had closed the issue. asking for followup because I think that may be rooted in a misunderstanding of who exactly closed this

Also I'd point out there is another issue here that is related to the new version of Yoast SEO 7.x:

Previously the workaround we were doing to allow us to keep using Yoast SEO and Coauthors Plus plugin was to remove the authors sitemap but keep the authors as indexed using meta robots. Not ideal, but unfortunately wasn't avoidable for us.

However in Yoast SEO 7.x there is no longer a GUI to manage XML sitemaps, the plugin assumes that if you set a post / taxonomy, etc.. to not show in search then it should be removed from XML sitemap as well.

That is probably good for most situations; but in this case it means that we have to choose between:

  1. 404 on author sitemap
  2. Noindexing author pages

Neither great options in our case.

Going to look into the Yoast SEO API to see if there is a workaround here.

Another user here running into this issue.

Just to chime in here, I have the same issue on a production website. Would love this to be fixed as I am getting this issue in Google Web Master Tool - Seach Console ==

We encountered an error while trying to access your Sitemap. Please ensure your Sitemap follows our guidelines and can be accessed at the location you provided and then resubmit. |  
-- | --

Help :(

I'm having the same problem. Also using the Co-Authors Plus plugin, and also discovered the problem when in the Google Search Console. My authors sitemap comes up as a soft 404

Hope you figure out a way to resolve this; I don't want to switch to a new SEO plugin again.

Same here. Looks like the issue was not solved in two years...

Correct solution needs a lot of changes in the code. In meantime, I'm sharing PHP snippet which isn't perfect:

add_filter( 'wpseo_build_sitemap_post_type', 'myseo_remove_author_taxonomy' );  

function myseo_remove_author_taxonomy( $type ) {
        if ( $type === 'author' ) {
                unregister_taxonomy( 'author' );
        }

        return $type;
}

I don't like this solution, but it works.

I'm coming here for the first time after finding out that our author_sitemap.xml file is returning a 404 error. I see that @moorscode and @stodorovic have been working on a solution...but I'm not very familiar with GitHub and am not sure what code/function I'm supposed to use as a fix.

Can someone post a link to the patch code and explain where it goes within the plugin code? Please!

The issue with @stodorovic's code above is that it then removes the guest authors entirely from Yoast's sitemaps.

@sstarzyk10 You can add my snippet in functions.php or wait Yoast SEO 9.7 which will fix this issue. If you’re not familiar with using code snippets, these articles have wonderful advice:
http://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/
http://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/

Fix is merged and will go into Yoast SEO 9.7. Guest authors is a feature of the co-authors plugin that is not currently compatible with the sitemaps of Yoast SEO. Our authors sitemap is based on the users, while the co-authors plugin registers a private taxonomy that is calls authors.

So ... the authors (co-authors) will not map to the articles?

I know this is closed but just wanted everyone who check this to know that this solution will disable sitemaps for the guest authors entirely, which most likely will go against your SEO strategy.

For our needs I ended up doing the following:

  1. Created custom 'guest-author' taxonomy and assigned it to posts.
  2. Converted all co-authors to the custom taxonomy and made sure their fields were migrated over properly with corrected slugs
  3. Updated all theme templates throughout the site to display custom taxonomy data vs co-authors
  4. Setup custom field on posts to assign guest author.

The only issue after this is that the sitemap will now have all guest authors under /guest-author/ instead of /author/. Our SEO actually preferred this. From there it would be up to your team to determine if you need to set up permanent redirects for the old guest author URLs.

Just downloaded Yoast SEO version 9.7.0, which was released today and confirmed it does resolve this issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings