Archived topic
Google Webmaster Tools Errors = Missing: author Missing: updated
13 replies · Started by Todd on January 11, 2016
Hi Tom, Just noticed in Google Webmaster Tools, a couple of static pages are showing Errors = Missing: author Missing: updated.
Does this have any negative effect on the site's performance, or does it need to be corrected? If so, how would I go about doing that?
Thanks!!!
Hi Todd,
It doesn't have any negative effect on performance.
Typically, static pages don't have author or updated/published tags - these tags are usually reserved for posts etc..
I need to look in to what Google thinks about adding these to pages but having them hidden (no one wants an author name or date on their static pages).
Hi, Tom!
I have such errors on every page.
Maybe because I hid this elements in theme customizer? http://joxi.ru/Dr83RQvuLbY4A6.png
Can I turn hEntry off like in this article? https://kb.yoast.com/kb/fixing-hcard-author-error/ If yes, where is better to place the code?
Those "errors" won't hurt your website, but it is because those elements aren't present.
You can remove the .hentry class with this function:
function tu_remove_hentry( $class ) {
$class = array_diff( $class, array( 'hentry' ) );
return $class;
}
add_filter( 'post_class', 'tu_remove_hentry' );
Thank you, Tom! I put this code to Simple PHP plugin. I hope it's right place to it)
That's perfect :)
Tom,
Is it possible to remove the hatom @ type for tags or hatom altogether?
I placed the code into my functions.php and it did not work.
function tu_remove_hentry( $class ) {
$class = array_diff( $class, array( 'hentry' ) );
return $class;
}
add_filter( 'post_class', 'tu_remove_hentry' );
Not really sure what you mean?
That code will remove the hentry class from your post elements.
Thanks for the reply Tom. After a few hours I finally got it cleared up. I am very amateur at coding and rely heavily on other examples.
For this project/website I am testing differences between a site that has full markups (schema etc..) and one without. I am not using it as a blog.
From my understanding, the hentry and hatom markups are something wordpress injects to signify that the content is syndicatable (if that's a word?)
I was able to manually remove all references of hentry/hatom markups by modifying files in my child theme removing markups such as:
entry-header
entry-meta
entry-summary
entry-content
etc
Additionally, I removed all link tags such as:
rel="home"
rel="bookmark"
etc
Further, I added code to my functions.php to remove the rel="category" and rel="tag" markups.
Thanks,
JB
Glad you got it all working.
Not sure if editing those classes are necessary, although maybe schema.org targets them.
Is there a way to fix this so that the author structured data will work for posts, and disable for tags, categories, and static pages?
Also, with the code snippet mentioned above, I am not clear on where that code is supposed to be placed.
Thanks,
Tom
So you want to remove the author completely from everywhere except for single posts?
The PHP can be added using these instructions: https://docs.generatepress.com/article/adding-php/
Thanks for the instructions.
Yes, I would like to keep the author attribute for posts and remove it from other areas of the site in order to clean up the Google Search Console issue.
Try this:
add_filter( 'generate_post_author_output', 'tu_post_author_single_only' );
function tu_post_author_single_only( $output ) {
if ( is_single() ) {
return $output;
}
return false;
}