: How to can I change the date displayed in Google Search's snippets to the modified date instead of the published date? I've read this previous question, and the answer there was to have only
I've read this previous question, and the answer there was to have only the modified date show on the website in order for Google to update the date displayed in their search results. So how do I delete the published date and display only the modified date?
I've tried for many hours watching YouTube Videos and using plugins, but to no avail. I would appreciate it if someone could help me.
More posts by @Si4351233
1 Comments
Sorted by latest first Latest Oldest Best
This is something that actually drove me slightly insane not long ago, I couldn't find anyone giving an accurate answer, almost like it was closely guarded secret ;) and hundreds of people looking for a straight answer and a code snippet to do so.
You are correct however that Google will pay attention to the modified date if its the only date/time on the page, therefore you need to only show the modified date when there is one. Giving you the "freshness" capability when revisiting and updating posts/pages.
Since you haven't mentioned what type of site/CMS you are using I'm going to go ahead and assume you are using Wordpress.
The code below you will need to replace your date/time stamp in your current template, this could be different depending on what theme you are using. Generally in single.php , loop-single.php or byline.php
<?php if (get_the_modified_time() != get_the_time()) : ?>
Updated On: <?php the_modified_time('F j, Y'); ?> at <?php the_modified_time('g:i a'); ?>
<?php else: ?>
Posted on <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?>
<?php endif; ?>
Source : www.rivmedia.co.uk/how-to-display-the-last-modified-date-of-your-posts-in-wordpress-for-seo-freshness/4902
You can also use search console to "Fetch as Google bot" to speed up indexing of the modified pages.
Happy modifying.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.