I’m wanting to have the published date shown on blog posts show as last updated on and the date it was updated. It now shows the published date. From what I’ve read I’m thinking this is to be done in the include/loop-index.php file. I’m hoping the SERPS will catch on to this too as my content is evergreen.
What code would I need to replace and put to do this?
Am I right about the folder to look for the code?
Hey wpcupid,
Thank you for your patience, there are a few Last Modified Date plugins that you could try, they don’t replace the published date but they do add schema for SEO:
WP Last Modified Info
Posts Modified Date
I did find this function for replacing the published date, I didn’t test it, but as the poster points out it could cause other issues, so I not sure if it is a good idea, but you could try it.
function reset_post_date_wpse_121565($data,$postarr) {
$data['post_date'] = $data['post_modified'];
$data['post_date_gmt'] = $data['post_modified_gmt'];
return $data;
}
add_filter('wp_insert_post_data','reset_post_date_wpse_121565',99,2);
Best regards,
Mike
Okay, thank you so much. I’m familiar with the WP Last Modified Info plugin and will get that going on my site. Thank you.
Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan Shannon
You can close. Thank you.
Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.
For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)
Best regards,
Mike