Automattic / Co-Authors-Plus

Multiple bylines and Guest Authors for WordPress
https://wordpress.org/plugins/co-authors-plus/
GNU General Public License v2.0
290 stars 205 forks source link

Missing "author" in Google Search Console #483

Open hellor0bot opened 6 years ago

hellor0bot commented 6 years ago

Hello,

Looks like the Co Authors Plus coauthors_posts_links() function generates the following markup:

<a href="http://test.test/author/author-name" title="Posts by Post Author" class="author url fn" rel="author">Post Author</a>

It is not recognized by Google and results in "missing author" errors in Google Search Console :(

It should be wrapped inside an element with the "author" and "vcard" classes instead:

<span class="author vcard">
<a class="url fn" href="http://test.test/author/author-name" title="View all posts by Post Author">Post Authors</a>
</span> 
philipjohn commented 6 years ago

Hi! The HTML output generated here is definitely valid HTML.

Please can you elaborate by linking to an example where you are seeing this please and the exact error that Google Search Console is reporting?

sergeysedykh commented 6 years ago

Hi, @philipjohn !

Thanks for your response. I'm afraid the HTML isn't valid according to the Schema specification.

WordPress adds hentry to the post_class() automatically.

http://microformats.org/wiki/hentry

image

It says:

author. required using hCard. [*]

The most important here is using hCard:

http://microformats.org/wiki/hCard

It means that the url and fn classes must be nested inside the main parent vcard.

Please see how TwentySeventeen implements it:

image

If the fn and url aren't nested inside the vcard and author the Google crawler won't recognise the author structured data and since it's required by the hentry it will throw errors.