Make Scheduled Posts Update The Modified Time in WordPress

Written by James Parsons James Parsons, updated on 08/23/2025 0 Comments

We all know how WordPress has two dates/times it saves for posts, right? The Publish date, and the Last Modified date. That way you can track when you originally published the page and when you last changed it.

Well it has always bugged me how scheduled posts didn’t schedule the modified date too. It kind of rats you out by telling the world that you modified it earlier than when you published it.

For example, let’s say you wrote an article today (Saturday August 23) and wanted to schedule it for the upcoming Monday, in 2 days time (Monday August 25th). Here’s what it would show on Monday:

  • Modified Date: Saturday August 23rd
  • Published Date: Monday August 25th

This might not bother you, but what if you didn’t want the world to know you wrote the post on a Saturday? You scheduled it for Monday – shouldn’t the date show Monday? Isn’t it weird that you are showing you last modified the post before the date you showed it was actually written? What about SEO implications?

Anyway, I wrote some code to fix this situation. Now if you schedule a post for Monday, it will show that it was fully created on Monday:

  • Modified Date: Monday August 25th
  • Published Date: Monday August 25th

Note: This only works for scheduled posts where you’re scheduling it to publish in the future.

Just drop this at the bottom of your functions.php file in your theme (/wp-content/themes/your-theme-name/functions.php:

/**
 * When a scheduled post is published, copy its post_date to post_modified.
 */
 
function update_modified_date_to_post_date( $post_id, $post ) {
  // Just in case this fires for something that isn't a post.
  if ( empty( $post ) || $post->post_type !== 'post' ) {
    return;
  }

  wp_update_post( [
    'ID'                => $post_id,
    'post_modified'     => $post->post_date,
    'post_modified_gmt' => $post->post_date_gmt,
  ] );
}
add_action( 'future_to_publish', 'update_modified_date_to_post_date', 10, 2 );

Did this help you? Do you have questions for me? Please let me know in the comments!

Related Code Snippets

Written by James Parsons

Hi, I'm James Parsons! I founded Content Powered, a content marketing agency where I partner with businesses to help them grow through strategic content. With nearly twenty years of SEO and content marketing experience, I've had the joy of helping companies connect with their audiences in meaningful ways. I started my journey by building and growing several successful eCommerce companies solely through content marketing, and I love to share what I've learned along the way. You'll find my thoughts and insights in publications like Search Engine Watch, Search Engine Journal, Forbes, Entrepreneur, and Inc, among others. I've been fortunate to work with wonderful clients ranging from growing businesses to Fortune 500 companies like eBay and Expedia, and helping them shape their content strategies. My focus is on creating optimized content that resonates and converts. I'd love to connect – the best way to contact me is by scheduling a call or by email.