Send each post's last modified date as an HTTP header, which crawlers and caches use to check for changes.
add_action( 'template_redirect', function (): void {
if ( ! is_singular() || is_user_logged_in() || post_password_required() || headers_sent() ) {
return;
}
header( 'Last-Modified: ' . get_post_modified_time( 'D, d M Y H:i:s', true ) . ' GMT' );
} );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
Crawlers and caches can ask “has this page changed since last time?” if the server tells them when it last changed. WordPress doesn’t send that date for normal pages. This snippet sends it on single posts and pages.
On template_redirect, once WordPress knows which post it’s showing, the snippet sends a Last-Modified header in the HTTP date format, in GMT, using the post’s modified time. It skips logged-in users and password-protected posts.
Open a post and look at the response headers in DevTools. You should see Last-Modified with the post’s update date.