- This topic has 27 replies, 4 voices, and was last updated 5 years, 6 months ago by Tom.
-
AuthorPosts
-
September 24, 2018 at 10:14 am #685223TomLead DeveloperLead Developer
Can you show me a post where the date has disappeared?
September 24, 2018 at 12:08 pm #685321September 24, 2018 at 4:06 pm #685486TomLead DeveloperLead DeveloperAdd this CSS:
.page-hero time.updated { display: inline-block; }
September 26, 2018 at 4:18 am #686632MohitHey Tom,
Thanks it’s working
September 26, 2018 at 10:04 am #687014TomLead DeveloperLead DeveloperYou’re welcome 🙂
September 28, 2018 at 6:22 pm #689036MohitHi Tom,
On applying the code that you shared I found that the date from the google snippet removed for updated posts. How can I show updated date in google search?
September 28, 2018 at 8:08 pm #689073TomLead DeveloperLead DeveloperI’m not sure I understand. What code removed the updated date?
September 28, 2018 at 8:53 pm #689088Mohitadd_filter( 'generate_page_hero_post_date', function() { $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="updated" datetime="%3$s" itemprop="dateModified">%4$s</time>'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); return $time_string; } );
this code OR:
.page-hero time.updated { display: inline-block; }
I am not sure which one but either of these
September 28, 2018 at 9:02 pm #689091TomLead DeveloperLead DeveloperNeither of those will remove the updated date.
The first snippet will show the updated date if it exists. If not, it will show the published date.
The second snippet simply shows the updated date HTML if necessary.
Here’s what I’m seeing on the post you linked to above: https://www.screencast.com/t/mOK8iCHeL
September 29, 2018 at 7:23 pm #689708MohitHey Tom,
Look at the screenshots I took after updating the posts and neither of them shows the updated date in google snippet:
https://prnt.sc/l0cea4
http://prntscr.com/l0cer5 and othersHowever, the posts I haven’t updated shows the date in Google snippet:
http://prntscr.com/l0cf5j and all other posts.
What could be the reason for this? And how can I fix this?
Thanks
September 30, 2018 at 10:25 am #690097TomLead DeveloperLead DeveloperNothing Google related is instant. It can take them weeks to update the dates.
As long as you’re displaying the updated date with the necessary schema, you’re doing all you can. The rest is up to Google.
https://webmasters.stackexchange.com/questions/78588/when-does-google-use-article-published-date-vs-article-modified-date-in-serp
https://webmasters.stackexchange.com/questions/59559/how-to-tell-how-old-a-page-is/59566#59566October 1, 2018 at 2:03 am #690440MohitHi Tom,
Yeah, I know nothing is instant with google but the screenshot I have sent (https://prnt.sc/l0cea4, http://prntscr.com/l0cer5) are for the posts that have been recrawled by Google after applying the code of the last update that you shared. And on recrawling the date disappeared on google snippet which was displaying before applying the code. I want to display the last updated date on google snippet just like this website:
Google Snippet: https://prnt.sc/l0qyqt
Actual Post: http://prntscr.com/l0qzj7As you can see from the above screenshots the google snippet date is Sept 5, 2018, however, the actual post date is July 30, 2017.
Thanks
October 1, 2018 at 10:45 am #690881TomLead DeveloperLead DeveloperHmm, I’m afraid I don’t really have an answer. The required text and schema exists and is visible.
It may be worth installing a plugin like this to see if it changes anything: https://wordpress.org/plugins/wp-structuring-markup/
-
AuthorPosts
- You must be logged in to reply to this topic.