- This topic has 13 replies, 5 voices, and was last updated 5 years, 7 months ago by
Tom.
-
AuthorPosts
-
January 11, 2016 at 8:58 am #165056
Todd
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 #165129Tom
Lead 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).
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 18, 2016 at 6:04 am #236390Olga
Hi, 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 #236467Tom
Lead 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' );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 19, 2016 at 1:46 am #236825Olga
Thank 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 #237009Tom
Lead DeveloperLead DeveloperThat’s perfect 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJanuary 11, 2017 at 6:55 am #262933John
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' );
January 11, 2017 at 9:38 am #263010Tom
Lead DeveloperLead DeveloperNot really sure what you mean?
That code will remove the
hentry
class from your post elements.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJanuary 11, 2017 at 10:40 am #263073John
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
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 #263181Tom
Lead DeveloperLead DeveloperGlad you got it all working.
Not sure if editing those classes are necessary, although maybe schema.org targets them.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJune 25, 2017 at 3:43 pm #338856Thomas
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,
TomJune 25, 2017 at 7:01 pm #338910Tom
Lead 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/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJune 26, 2017 at 5:46 am #339108Thomas
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.
June 27, 2017 at 12:07 am #339787Tom
Lead 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; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.