- This topic has 16 replies, 5 voices, and was last updated 5 years, 2 months ago by David.
-
AuthorPosts
-
September 11, 2017 at 1:26 am #383074Velin
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.
September 11, 2017 at 1:26 pm #383437TomLead DeveloperLead DeveloperHi 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
September 12, 2017 at 2:37 am #383740VelinWell, 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!
September 12, 2017 at 9:54 am #384030TomLead DeveloperLead DeveloperShould be fine – now it’s just up to Google to re-index and show the updated text.
September 13, 2017 at 11:21 pm #385070VelinThank you!
September 13, 2017 at 11:58 pm #385080TomLead DeveloperLead DeveloperNo problem ๐
September 25, 2019 at 1:50 am #1018372SabbirSame 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?
September 25, 2019 at 3:21 am #1018432DavidStaffCustomer SupportHi 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.
September 25, 2019 at 6:07 am #1018537Sabbirso, how can I show only updated date on Google?
September 25, 2019 at 9:46 am #1018822LeoStaffCustomer SupportThis should help:
https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-dateAdding PHP: https://docs.generatepress.com/article/adding-php/
Let us know ๐
September 25, 2019 at 10:02 am #1018839Sabbirhello Leo, where to add this code?
September 25, 2019 at 10:13 am #1018849SabbirYes, it works fine, but I want to show here “last Updated” before the date
September 25, 2019 at 10:37 am #1018877LeoStaffCustomer SupportCan you link me to the page in question?
September 25, 2019 at 10:47 am #1018894Sabbirstill showing to date . Update and modify date in structured-data testing-tool
here is the link:
September 25, 2019 at 11:39 am #1018923LeoStaffCustomer SupportSo you want last updated to show in live site right?
Try this CSS:
.updated-date:before { content: "Last updated: "; }
-
AuthorPosts
- You must be logged in to reply to this topic.