MY NUMBER 1 RECOMMENDATION TO CREATE FULL TIME INCOME ONLINE: CLICK HERE
Do you want to add an old post notification in WordPress?
If you’ve been creating content for a while, then there’s a chance that some of your content is out of date.
In this article, we will show you how to easily add an old post notification to your WordPress blog.
Why add an old post notification to WordPress blog posts
Content decay (outdated blog posts) can be a problem for growing WordPress blogs.
Depending on your niche, sometimes your content can become irrelevant, wrong or inappropriate after a while. This can result in poor user experience, higher or lower bounce rates search rankings.
Ideally, we would like to edit these articles and update them with more useful, accurate and up-to-date information.
However, this is not always possible because your site may have too many old articles and you may not have enough resources to update them. In this case, adding a notification on the old post can be useful for your users.
This will let them know that the content is slightly older and should take this into account when using the information presented on this page.
Another solution that many blogs use is to simply add a ‘Last Updated Date’ instead of the published date.

With that said, let’s see how you can add an old post notification in WordPress and how to display the last updated date in your articles.
- 1st way. Show old post notification using plugin
- 2nd way. Display the date of the last update in WordPress
- 3rd way. Show old post notification without plugin (code method)
1st way. Show old post notification using plugin
This method is easier and recommended for all users who want to display a notification about an old post.
First you need to install and activate DX obsolete to include. Check out our step-by-step guide for more details how to install a WordPress plugin.
After activation, you must visit Settings » Deprecated plugin settings configuration page.

Here you need to select the period and duration. This is the time after which the plugin will consider the post as old.
Below you can specify a custom message to display on older posts and enable a notification to appear on all older posts. Don’t worry, you’ll be able to hide it for certain 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.

Don’t forget to click the Save Changes button to save your settings.
You can now visit the old post on your site to see the plugin in action.

Hiding old post notifications in individual posts
Now let’s say you have an article that is older but still accurate, up-to-date, and has great search results. You might want to hide the old post notification there.
Likewise, what if you updated an old post with new information. The plugin will continue to show a notification about an old post because it uses the post’s publication date to determine its age.
To fix this, you can edit the post and scroll down to the “Obsolete Notice” tab under the Post to panel block editor. From here, simply clear the notification option and save your changes.

The plugin will now no longer show notifications about the old post in this article.
2nd way. Show the last modified date for your posts
Many WordPress sites display the last modified date of their blog posts. Some also confuse the publication date with the last modification date.
The advantage of this method is that it shows users when the post was last updated without showing the old post message.
First you need to install and activate Information about the latest WP change to include. Check out our step-by-step guide for more details how to install a WordPress plugin.
After activation, go to Settings » WP Last Modified Info plugin settings configuration page.

On the settings page, you need to turn on the Global display of last modified information switch. After that, you can choose how you want to display the changed date.
You can replace the post date, display it before or after the content, or manually insert it into the post.
Below that, you’ll find a bunch of options. If you’re not sure, you can leave them at the defaults.
Don’t forget to click the Save Settings button to save your changes.
You can now visit your website to see the latest updated information for all blog posts.

The problem with this method is that it will show the last updated date for all posts, including newer posts.
You can set the time gap in the plugin settings. However, this gap is limited to only 30 days.

The plugin also offers three blocks that you can manually insert into a post or page to display the last changed information.

You also have the option to use custom CSS to style the last updated date notification. 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;
}
3rd way. Add a notification on the old post with the code
This method requires you to manually add code to your WordPress theme files. If you haven’t already, check out our guide on how to do it add custom code snippets to WordPress.
Simply copy and paste the following code into 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 as all articles published at least one year ago.
Then check if the post is more than a year old. If it is, then check if the post has been updated after posting. It then displays a notification based on these checks.
This is what it looked like on our demo site for a post that is old and has never been updated.

This is what the post looked like, which is old, but was updated after it was posted.

We have 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 an old post notification on your WordPress blog. You may also want to see ours WordPress SEO Guide or see our selection the best popular WordPress post plugins.
If you liked this article, please subscribe to ours YouTube channel for WordPress video tutorials. You can also find us at Twitter and Facebook.
Publication How to add an old post notification to your WordPress blog first appeared on WP Beginner.
MY NUMBER 1 RECOMMENDATION TO CREATE FULL TIME INCOME ONLINE: CLICK HERE