Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Add Old Post Notification on Your WordPress Blog

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Do you want to add an old post notification in WordPress?

If you have been producing content for some time now, then there is a chance that some of your content may be outdated.

In this article, we’ll show you how to easily add old post notification to your WordPress blog.

Adding old post notice to WordPress

Why Add Old Post Notification to WordPress Blog Posts

Content decay (outdated blog posts) can be a bit of a problem for a growing WordPress blogs.

Depending on your niche, sometimes your content may become irrelevant, incorrect, or inappropriate over a period of time. This may cause a bad user experience, a higher bounce rate, and lower search rankings.

Ideally, you would want to edit those articles and update them with more useful, accurate, and up-to-date information.

But that’s not always possible because your site may have too many old articles, and you may not have enough resources to update them. In that case, adding an old post notification may be helpful for your users.

It will let them know that the content is a bit older, and they should keep this in mind when using the information presented on that page.

Another solution that many blogs use is by simply adding the ‘Last updated date’ instead of the publishing date.

An older article with last updated date

That being said, let’s take a look at how you can add the old post notification in WordPress, and how to display the last updated date on your articles.

Method 1. Display Old Post Notification Using Plugin

This method is easier and recommended for all users that want to display an old post notification.

First, you need to install and activate the DX Out of Date plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the Settings » Out of Date page to configure plugin settings.

Out of date settings

Here, you need to choose the period and duration. This is the time after which a post will be considered old by the plugin.

Below that you can provide a custom message to display on older posts and enable the notification to be displayed for all old posts. Don’t worry, you’ll be able to hide it for specific posts by editing them.

On the settings page, you can also choose post types, colors for the notification box, and add custom CSS if needed.

Advanced settings for outdated posts

Don’t forget to click on the Save Changes button to store your settings.

You can now visit an old post on your website to see the plugin in action.

Old post notification displayed on an article

Hiding Old Post Notification on Individual Posts

Now let’s say you have an article that is older, but it is still accurate, up-to-date, and has great search rankings. You may want to hide the old post notification there.

Similarly, what if you have updated an old post with new information. The plugin will keep showing old post notification because it uses the post’s published date to determine its age.

To fix this, you can edit the post and scroll down to the ‘Out of Date Notification’ tab under the Post panel of the block editor. From here, simply uncheck the notification option and save your changes.

Hide old post notification

The plugin will now stop showing old post notification on this particular article.

Method 2. Display Last Modified Date for Your Posts

A lot of WordPress websites display the last modified date for their blog posts. Some replace the publish date with the last modified date as well.

The advantage of this method is that it shows users when a post was last updated without showing an old post message.

First, you need to install and activate the WP Last Modified Info plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, head over to Settings » WP Last Modified Info page to configure plugin settings.

Last modified settings

On the settings page, you need to turn on the Global display of the last modified info toggle. After that, you can choose how you want to display the modified date.

You can replace the published date, show it before or after the content, or manually insert it into a post.

Below that, you’ll find a bunch of options. If you are unsure, then you can leave them to default.

Don’t forget to click on the Save Settings button to store your changes.

You can now visit your website to see the last updated information for all your blog posts.

Last updated notice

This problem with this method is that it will show the last updated date for all posts including the newer posts.

You can set a time gap under plugin settings. But this gap is only limited to 30 days.

Time gap between published and updated posts

The plugin also provides three blocks that you can manually insert into a post or page to display last modified info.

Add last modified information using blocks

You also have the option to use custom CSS to style your last updated date notice. We used the following custom CSS in the screenshots above.

p.post-modified-info {
    background: #fbffd8;
    padding: 10px;
    border: 1px solid orange;
    font-size: small;
    font-weight: bold;
}

Method 3. Add Old Post Notification Using Code

This method requires you to manually add code to your WordPress theme files. If you haven’t done this before, then take a look at our guide on how to add custom code snippets in WordPress.

Simply copy and paste the following code in your theme’s single.php template.

// Define old post duration to one year
$time_defined_as_old = 60*60*24*365; 

// Check to see if a post is older than a year
if((date('U')-get_the_time('U')) > $time_defined_as_old) {

$lastmodified = get_the_modified_time('U');
$posted = get_the_time('U');

//check if the post was updated after being published
 if ($lastmodified > $posted) {
 
// Display last updated notice
      echo '<p class="old-article-notice">This article was last updated ' . human_time_diff($lastmodified,current_time('U')) . ' ago</p>';   

  } else { 
// Display last published notice 
echo '<p class="old-article-notice">This article was published ' . human_time_diff($posted,current_time( 'U' )). 'ago</p>';

}
}

This code defines old posts to be any articles published at least one year ago.

After that, it checks if a post is older than a year. If it is, then it checks if the post was updated after publication. Then it displays a notice based on those checks.

Here is how it looked on our demo website for post that is old and was never updated.

Last updated information for old post

Here is how it looked for a post that is old, but it was updated after being published.

An old post that is never updated

We customized the old post notification with the following custom CSS.

p.old-article-notice {
    background: #fbffd8;
    padding: 10px;
    border: 1px solid orange;
    font-size: small;
    font-weight: bold;
}

We hope this article helped you learn how to easily display old post notification on your WordPress blog. You may also want to see our WordPress SEO guide or see our pick of the best popular posts plugins for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

2 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Gina Davis says

    As a reader of a blogs, I prefer blogs that do have dates and specifically telling me last time they reviewed the blog for accuracy. Not just when they made an update. Often I am looking for solutions to answers and this type of info goes a long way towards accuracy of information.

    As a blogger, I always included dates. And since a few of my blogs do occasionally need update, I always add when the post was last looked at and what changes if any where made.

    Again this all does go back to the type of content in blog. Some content stands the test of time, but blogs with instructions and guides are just important, imho.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.