- This topic has 11 replies, 2 voices, and was last updated 6 years, 2 months ago by Tom.
-
AuthorPosts
-
January 24, 2018 at 2:40 am #478684Edin
I’ve noticed some errors in the rich snippet tool from Google:
Missing: author
Missing: updatedI fear that this has negative implications on ranking in the search engines.
Is there a way to fix this?
Thank you!
January 24, 2018 at 8:57 am #478991TomLead DeveloperLead DeveloperHi there,
It shouldn’t have any negative impact, but it helps having those elements.
Is there a specific page you’re testing for this I can check out?
January 24, 2018 at 9:28 am #479015EdinHi Tom,
The Google Search Console says that the error is on every page of the site (I’ve entered the URL when starting this topic).
Thanks,
EdinJanuary 24, 2018 at 9:55 pm #479344TomLead DeveloperLead DeveloperIt looks like you’ve removed the author and date, which is what those errors are complaining about.
It won’t hurt your rankings, but Google is looking for those elements, and they don’t exist.
January 24, 2018 at 10:42 pm #479357EdinI haven’t removed them consciously… where should they be, and how do I add them back in?
January 24, 2018 at 10:43 pm #479358EdinWhen you look at the pages you see that the author is displayed right below the post title… that’s weird.
January 25, 2018 at 10:49 am #479830EdinOkay, I think I found a fix. According to Yoast, I should change:
<span class="author_name"><?php the_author(); ?></span>
to
<span class="vcard author author_name"><span class="fn"><?php the_author(); ?></span></span>
Problem is, I have this in “After Entry Title”:
<a class="author-name" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>"><?php the_author(); ?></a>
What would be the corresponding change here?
Thank you so much for your help so far!
January 25, 2018 at 12:28 pm #479912TomLead DeveloperLead DeveloperSo you’ve added that code inside GP Hooks instead of using the core author display?
You should be able to add the markup like this:
<span class="vcard author author_name"><a class="author-name" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>"><span class="fn"><?php the_author(); ?></span></a></span>
January 26, 2018 at 12:48 am #480193EdinThank you so much Tom, that worked beautifully!
I’ve also tried to add the “update time”, can you please tell if this is correct?
<span class="date updated published"><time datetime="<?php the_modified_time('Y-m-d'); ?>"><?php the_modified_time('F jS, Y'); ?></time></span>
Thanks again,
EdinJanuary 26, 2018 at 9:38 am #480625TomLead DeveloperLead DeveloperYou’d have to do this:
<span class="date updated published"><time datetime="<?php the_modified_time('Y-m-d'); ?>" itemprop="dateModified"><?php the_modified_time('F jS, Y'); ?></time></span>
January 26, 2018 at 10:06 am #480644EdinAwesome Tom! That worked as well.
I want to thank you for all your help so far. The support and willingness to help out is really amazing, on top of that great product that you offer.
Thanks again!
January 26, 2018 at 10:10 am #480649TomLead DeveloperLead DeveloperYou’re very welcome! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.