Here is a simple code snippet that you can add to your theme functions.php file to show the “last updated” date in your posts.
function my_last_updated_date( $content ) {
$u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time >= $u_time + 86400) {
$updated_date = get_the_modified_time('F jS, Y');
$updated_time = get_the_modified_time('h:i a');
$custom_content .= '<p class="last-updated entry-meta">Last updated on '. $updated_date . ' at '. $updated_time .'</p>';
}
$custom_content .= $content;
return $custom_content;
}
add_filter( 'the_content', 'my_last_updated_date' );
A new line will be added to the beginning of the post content if the last modified and published time is different:

Was this post helpful?
Let me know if you liked the post. That’s the only way I can improve. 🙂