Do you want to create a notice for an old post in WordPress?
If you’ve been creating material for a while, there’s a potential that part of it is now out of date.
We’ll teach you how to quickly add old post notifications to your WordPress blog in this article.
Why Add Old Post Notification to WordPress Blog Posts
Content decay (old blog entries) can be an issue for expanding WordPress sites.
Depending on your specialty, your material may become obsolete, wrong, or improper over time. This might result in a worse user experience, a greater bounce rate, and poorer search rankings.
Ideally, you should revise and update those articles with more valuable, accurate, and up-to-date material.
However, this isn’t always achievable because your site may have too many outdated articles and not enough resources to refresh them. In such a scenario, including an old post notification might be beneficial to your users.
It will notify readers that the content is a little out of date, and they should bear this in mind while utilizing the information on that page.
Another approach that many blogs take is to just include the ‘Last updated date’ instead of the publication date.
That started, let’s look at how to add an old post notification in WordPress, as well as how to display the last updated date on your articles.
- Method 1: Using a Plugin to Display Old Post Notification
- Method 2: In WordPress, show the most recently updated data.
- *Method 3: Show Old Post Notification Without Using a Plugin (Code Method)
Method 1. Display Old Post Notification Using Plugin
This technique is simpler and is suggested for all users who wish to see an old post notification.
To begin, install and activate the DX Out of Date plugin. For additional information, visit our step-by-step guide to installing a WordPress plugin.
After activation, go to the Parameters » Out of Date page to customize the plugin settings.
You must select the term and length here. This is the time after which the plugin considers a post to be old.
Below that, you can provide a custom message to appear on earlier posts and allow the notice to appear on all older posts. Don’t worry, you can disable it for certain posts by amending them.
On the settings page, you may also select post types, and notification box colors, and apply custom CSS if necessary.
Remember to click the Save Changes button to save your choices.
You may now see the plugin in action by visiting an old post on your website.
Hiding Old Post Notification on Individual Posts
Let’s imagine you have an older article that is still correct, up to date and has high search ranks. You should probably bury the old post notification there.
Similarly, suppose you updated an older post with fresh information. Because it utilizes the post published date to calculate its age, the plugin will continue to display old post alerts.
To resolve this, update the post and navigate to the ‘Out of Date Notification’ option in the Post panel of the block editor. Simply uncheck the notification box and save your settings.
On this specific article, the plugin will no longer display old post alerts.
Method 2. Display Last Modified Date for Your Posts
Many WordPress websites indicate the date that a blog post was last edited. Some sites may substitute the publication date with the last edited date.
This solution has the advantage of showing users when a post was last updated without displaying an old post notice.
You must first install and activate the WP Last Modified Info plugin. For additional information, visit our step-by-step guide to installing a WordPress plugin.
After activating the plugin, navigate to the Settings » WP Last Modified Info page to change plugin settings.
On the settings page, enable the Global display of the most recently changed information option. Following that, you may choose how you want the amended date to be displayed.
You have the option of replacing the published date, displaying it before or after the text, or manually inserting it into a post.
There are more possibilities below that. If you are unsure, you can leave them at their default settings.
Don’t forget to save your changes by clicking the Save Settings button.
You may now go to your website and see the most recently updated information for all of your blog entries.
The issue with this technique is that it displays the most recently updated date for all posts, even subsequent entries.
A time gap can be defined in the plugin options. However, this pause is just for 30 days.
The plugin also includes three blocks for manually inserting into a post or page to display the latest modified information.
You may also apply custom CSS to customize your latest updated date message. In the screenshots above, we applied the following custom CSS.
border: 1px solid orange;
Method 3. Add Old Post Notification Using Code
This solution necessitates manually inserting code into your WordPress theme files. If you’ve never done this before, see our instructions on how to create custom code snippets in WordPress.
Simply copy and paste the following code into the single.php template of your theme.
// 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>’;
// Display last published notice echo
echo ‘<p class=”old-article-notice”>This article was published ‘ . human_time_diff($posted,current_time( ‘U’ )). ‘ago</p>’;
This code classifies ancient postings as any articles that were published at least a year ago.
Then it checks to see if the post is more than a year old. If it is, it checks to see if the post was modified after it was published. Based on such tests, it then shows a message.
Here’s how it appeared on our demo website for an old article that was never updated.
Here’s how it appeared for an old post that was modified after it was published.
The following custom CSS was used to alter the old post notification.
border: 1px solid orange;
We hope this article has shown you how to quickly display an old post notice on your WordPress site. You might also be interested in our WordPress SEO guide or our list of the top popular WordPress posts plugins.