how to update your wordpress post publish date

3 Ways to Update Your Already Published Blog Post Date

In WordPress by Nick BennettLeave a Comment

how to update your wordpress post publish date

Question: Can I update the date of my blog posts if I’ve already published them?

Answer: Yes you can. Here’s a few different ways to achieve this.

Scenario:

So you published a killer post last year that was very popular with your readers and got tons of Twitter love. Today, you happen to go back and re-read it, only to find out that it’s a little outdated and needs to be “freshened” up a bit. So, you make your changes and hit the Publish button. Done. Same killer post, with a fresh makeover.

Unfortunately, the date on your newly updated post is that same original date, which if you think about it, is technically correct but not completely accurate. In my humble opinion, good blog posts that get updated and changed should show the date from the last update. Books have published dates. Any changes to an already published book essentially becomes the second edition of that book …with a new published date. Blog posts are not books (get outta here!), and therefore should not be treated the same when it comes to the published date.

If you have a ton of great content written over several years then you have some old blog posts that could use a little refresher. First, I highly recommend that you take a gander at some of those “oldies but goodies” posts, make some necessary updates to the ones you think need it and then do one of the following three things.

For the first two options below you will need to find and edit the following files:

single.php

page.php

index.php

In these files you will need to look for the following code (note: not all themes will have the same code but you should see something similar):

[php]<!–?php the_modified_time(‘F jS, Y’);?–>[/php]

1. Keep the original blog post date but add a second, last updated date.

Published on October 8th, 2012 at 9:07 am, Last Updated on November 6th, 2013 at 11:03 am

[php]<!–?php if (get_the_modified_time() != get_the_time()) : ?–>

Published on <!–?php the_time(‘F jS, Y’); ?–> at <!–?php the_time(‘g:i a’); ?–>, Last Updated on <!–?php the_modified_time(‘F jS, Y’); ?–> at <!–?php the_modified_time(‘g:i a’); ?–>

<!–?php else: ?–>

Published on <!–?php the_time(‘F jS, Y’); ?–> at <!–?php the_time(‘g:i a’); ?–>

<!–?php endif; ?–>[/php]

Code translation: If the new updated date/time is not equal to the original post date/time, then show the original publish date/time followed by the new updated date/time. If your blog post has not been updated since it was originally published, then only the original publish time will be seen.

2. Just show the most recent date.

Last Updated on November 6th, 2013 at 9:00 AM

[php]<!–?php if (get_the_modified_time() != get_the_time()) : ?–>

Last Updated on <!–?php the_modified_time(‘F j, Y’); ?–> at <!–?php the_modified_time(‘g:i a’); ?–>

<!–?php else: ?–>

Published on <!–?php the_time(‘F j, Y’); ?–> at <!–?php the_time(‘g:i a’); ?–>

<!–?php endif; ?–>[/php]

Now these two options will not give your blog post a new original publish date. Rather, they simply show a subsequent “updated” date. Hence, these will not be reordered in your blog feed.

The third, “code-less” option is very easy and it will actually change the original publish date of your post. This would actually result in changing the date in your blog feed. For example, if you edited an old blog post and changed the new publish date to today, at this very second, it would become your most recently published blog post. It would be the most recent post in your blog feed. Keep that in mind.

 3. Change original post date.

To do this, just go to the blog post you want to edit, change the publish date and click the publish button. It really is that easy.

Leave a Comment