- This topic has 13 replies, 5 voices, and was last updated 6 years, 10 months ago by Tom.
-
AuthorPosts
-
January 11, 2016 at 8:58 am #165056Todd
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!!!
January 11, 2016 at 1:20 pm #165129TomLead DeveloperLead DeveloperHi 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).
October 18, 2016 at 6:04 am #236390OlgaHi, Tom!
I have such errors on every page.
Maybe because I hid this elements in theme customizer? http://joxi.ru/Dr83RQvuLbY4A6.pngCan 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?
October 18, 2016 at 9:15 am #236467TomLead DeveloperLead DeveloperThose “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' );
October 19, 2016 at 1:46 am #236825OlgaThank you, Tom! I put this code to Simple PHP plugin. I hope it’s right place to it)
October 19, 2016 at 10:26 am #237009TomLead DeveloperLead DeveloperThat’s perfect 🙂
January 11, 2017 at 6:55 am #262933JohnTom,
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' );
January 11, 2017 at 9:38 am #263010TomLead DeveloperLead DeveloperNot really sure what you mean?
That code will remove the
hentry
class from your post elements.January 11, 2017 at 10:40 am #263073JohnThanks 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
etcAdditionally, I removed all link tags such as:
rel=”home”
rel=”bookmark”
etcFurther, I added code to my functions.php to remove the rel=”category” and rel=”tag” markups.
Thanks,
JB
January 11, 2017 at 7:47 pm #263181TomLead DeveloperLead DeveloperGlad you got it all working.
Not sure if editing those classes are necessary, although maybe schema.org targets them.
June 25, 2017 at 3:43 pm #338856ThomasIs 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,
TomJune 25, 2017 at 7:01 pm #338910TomLead DeveloperLead DeveloperSo 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/
June 26, 2017 at 5:46 am #339108ThomasThanks 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.
June 27, 2017 at 12:07 am #339787TomLead DeveloperLead DeveloperTry 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; }
-
AuthorPosts
- You must be logged in to reply to this topic.