Archived topic
Last updated date not shown in the search results
16 replies · Started by Velin on September 11, 2017
Hello,
I want to display the last updated date of my posts in the Google search results and I've submitted a topic about that a few weeks ago. You've provided me with the following code, which hides the published date and instead shows only the updated date of the posts:
.posted-on .updated {
display: inline-block;
}
.posted-on .published {
display: none;
}
.posted-on .updated:before {
content: "Last updated: ";
}
This is working only on the website, where the updated date is visible. However, once I switched the theme from my old one to GeneratePress and the search box indexed the website again, only the published date is shown in the results. Will you please let me know what needs to be done to fix that? With all old themes that I've previously used it was just a matter of simple functions.php edit to achieve that and it was working great.
Any thoughts will be much appreciated.
Hi there,
If the updated date is in your source and includes microdata (it does by default), Google will pick it up. You can run your page through Google and see if it's reading the updated date: https://search.google.com/structured-data/testing-tool
Well, I've checked the post and I'm able to see the published and updated dates:
updated
August 23, 2017
Those are located in the 'hatom' element, so I believe everything is fine on my end, correct? It totally depends from Google to decide whether or not to show the modified date of the post.
Thanks!
Should be fine - now it's just up to Google to re-index and show the updated text.
Thank you!
No problem :)
Same problem. and also Google re-index my post but still showing published date not updated date (See SS: http://prntscr.com/paooe5). what can I do now?
Hi there,
your search console is displaying both the published and updated ( modified ) dates so it is working correctly. Are you displaying the Updated Date on the actual Post? If so then Google should see that and re-index the page at some point.
so, how can I show only updated date on Google?
This should help:
https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let us know :)
hello Leo, where to add this code?
Yes, it works fine, but I want to show here "last Updated" before the date
Can you link me to the page in question?
still showing to date . Update and modify date in structured-data testing-tool
here is the link:
So you want last updated to show in live site right?
Try this CSS:
.updated-date:before {
content: "Last updated: ";
}