Hi, guys, I have been spending many hours updating old stuff.
I updated a few of my blogpost from 2018 > 2020.
Not just date but I also tried to make it evergreen. For example, my old post was 500 words long but I reformat the content length is now more 1800+ words.
But after editing the content I just change the date and make updates.
But here’s the game - In SERP the date will be changed, and it is good at a point of visitors.
But What what about SEO and search bot?
I mean when I checked the structure data. The last modified and updated dates are the same. (I know it need to add code, I added below code bust still not working)
But when I check the structure date of another blog both dates are different.
Check below example of Moz
And do you know the funniest part, these sites do not care about SERP but they focus on structure date in order google can understand both dates.
Somewhere I learned content age is also matters. So I think by reading dateModified and datePublished Google understands, how content is old?
So for this requirement, I googled and found the following code to generatepress theme. Unfortunately, it not working for me.
add_filter( 'generate_post_date_output', function( $output, $time_string ) {
$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">Published on: %2$s</time>';
if ( get_the_date() !== get_the_modified_date() ) {
$time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Last Updated on: %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 sprintf( '<span class="posted-on">%s</span> ',
$time_string
);
}, 10, 2 );
Please, Guys, give me solution and also do research and implement yourself, Not sure but maybe it a ranking factor.