Hosting Tutorial & Guide

How to Add an Expiration Date to WordPress Posts

updated on Jun 06, 2017
How to Add an Expiration Date to WordPress Posts Some content on your WordPress site keeps evergreen because it can be useful all the time. But some posts are not. Containing time-sensitive information, these posts will "expire" one day.

For example, if you have written a post for limited-time coupon codes, contests, giveaways, events or seasonal announcements, you will want to add an expiration date to it so as to inform your visitors that the information included in it is no longer useful after the specific time. Also, an expiration date can sometimes generate a sense of scarcity, which helps increase the conversion rate.

In the case that you are interested in such a technique, you can follow the tutorials below to learn how to add a simple expiration date to any WordPress post, and how to change the post content automatically when it expires.

Add an Expiration Date to WordPress Posts with Plugin

Since coding is not the proper method for most people, we suggest you use a plugin called Simple Post Expiration to achieve the goal. This plugin is completely free to use, and more importantly, it comes with useful features.
  • It allows you to add an expiration date easily to your posts. And when a post is expired, the "Expired" prefix will be added to the post title.
  • There is a shortcode for you to change the content of the expired post.
After installing the plugin, you can use it with the guidance below.

Add an Expiration Date to a Post

Simple Post Expiration is a simple plugin that doesn't come with extra settings to deal with, so as soon as it is activated, you can start using it. Now create a new post or edit any existing post, and you will find an "Expires" option in the Publish meta box.

Expires

To set an expiration date for the post, click on the "Edit" link, and then select a date when the post is planned to expire. At last, publish or update the post to save the change.

Expiration Date

When the expiration date you set is reached, an "Expired" prefix will be added to the post title automatically.

Expired

Expire the Post Content with Shortcode

With the "Expired" prefix, your readers will know this post is expired, but they can still read the content in it because the plugin doesn't make any change to the post content so far. However, it is possible for you to expire the content, too. The plugin offers a shortcode to help you do this.

Depending on your needs, you can simply expire some or all of the content by wrapping it with the [expires] shortcode.

Expire Content with Shortcode

With this shortcode, the wrapped content will be replaced by the following information.

Item Expired

In fact, you don't have to display the default message because the shortcode allows you to customize it by adding a parameter. Below is an example.

Customize Message

You can add a custom message in the parameter so as to show your own words to your readers.

Custom Message

Final Thought

Simple Post Expiration is a good plugin that allows you to expire content based on your plan. Besides the examples shown above, there are in fact several other parameters you can use in the shortcode. For example, you can add expires_on to show an expiration date in those posts that haven't expired yet to generate scarcity. You can learn more by installing the plugin and make use of it.