3 Steps to Set Post Expiration Date in WordPress
Tags: wordpress
Published: 2021-02-01 10:25:49

<!-- wp:paragraph -->

<p>Hiding a post on a designated date automatically in WordPress is an amazing and convenient feature that you should try. It is not that hard to have this feature on your site; you only need to use a specialized plugin like Post Expirator and configure it a little more.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Let's go and see how you can get this done!</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>When to Create the Expiration Date for Posts?</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>When you have a post that only values on certain days, you need to delete or hide it on the expiry date to avoid misleading. For example:</p>

<!-- /wp:paragraph -->

<!-- wp:list -->

<ul>

<li>Recruitment posts</li>

<li>Promotion announcement</li>

<li>Short-term contests, competitions, etc.</li>

<li>...</li>

</ul>

<!-- /wp:list -->

<!-- wp:paragraph -->

<p>Normally, if you want to delete or hide posts, you need to remember the expiry date and do the work manually. It might be very troublesome, especially if you sleep your mind and forget the date. Thus, all you need is a plugin that handles everything: hiding posts automatically, moving posts to another place after a period of time, etc.</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>How to Expire Posts / Pages in WordPress</h2>

<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->

<h3>Step 1: Install and Activate Post Expirator Plugin</h3>

<!-- /wp:heading -->

<!-- wp:paragraph -->

[Post Expirator](https://wordpress.org/plugins/post-expirator/) is the most common plugin to create expiry dates for posts with more than 100.000 activations on wordpress.org.

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Firstly, you need to <a href="https://gretathemes.com/install-wordpress-plugin/">install and activate the plugin</a> by going to <strong>Admin Dashboard &gt; Plugins &gt; Add New</strong>. In the search box, enter <strong>Post Expirator</strong> and then click <strong>Install Now &gt; Activate</strong> to start installing and activating the plugin.</p>

<p><img class="aligncenter" src="https://i.imgur.com/jRUkcHi.png" alt="Install and activate the Post Expirator plugin in WordPress" width="1366" height="625" /></p>

<!-- /wp:embed -->

<!-- wp:paragraph -->

<p>So you have done with the installing and activating progress. Let's move up to the configuration!</p>

<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->

<h3>Step 2: Basic Configuration for Post Expirator Plugin</h3>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>Before setting up an expiry date for a post, you should configure Post Expirator a little bit. Basic configuration in the <strong>Settings </strong>section of the plugin helps to adjust some items based on your need and purpose (such as time format, post status after expiry dates, ...).</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>First, go to <strong>Settings &gt; Post Expirator</strong>. The setting page of the plugin will display as below:</p>

<p><img class="aligncenter" src="https://i.imgur.com/yiXYz7Y.png" alt="Configure the Post Expirator plugin in WordPress" width="1348" height="625" /></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>You should see 4 tabs that are:</p>

<!-- /wp:paragraph -->

<!-- wp:list -->

<ul>

<li><strong>General Settings</strong>: This is the most important tab to set up expiry dates</li>

<li><strong>Defaults</strong>: Includes configurations for two post types: <a href="https://gretathemes.com/post-page-different/">post and page</a></li>

<li><strong>Diagnostics</strong> and <strong>View Debug Log</strong>: These two include configurations that help diagnose and fix bugs. However, if you are a basic WordPress user, you can skip this tab.</li>

</ul>

<p><img class="aligncenter" src="https://i.imgur.com/eznF7d7.png" alt="Configure 4 tabs of Post Expirator plugin in WordPress" width="644" height="516" /></p>

<!-- /wp:list -->

<!-- wp:paragraph -->

<p>Now let's take a closer look at each tab.</p>

<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->

<h4>General Settings Tab</h4>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>In this tab, you should see some entries such as:</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p><strong>Defaults</strong></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>This entry includes some options:</p>

<!-- /wp:paragraph -->

<!-- wp:list -->

<ul>

<li><strong>Date Format</strong> and <strong>Time Format</strong>: Choose your familiar time format to manage the feature easily and avoid confusion.</li>

<li><strong>Default Date</strong>/<strong>Time Duration</strong>: This one is the most important. I will make it clear in Step 3, so just set it as <strong>None </strong>for now.</li>

</ul>

<!-- /wp:list -->

<!-- wp:paragraph -->

<p><strong>Category Expiration</strong></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Sometimes, you don't want to delete the post but move it to another category so that visitors can find it again if needed or for any other reasons. For instance, an expired recruitment post will be moved from "December Recruitment" to "Expired Posts" category.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>In <strong>Category Expiration</strong>, choose a category that you want to move expired posts in. If not, leave this part blank.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p><strong>Expiration Email Notification</strong></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>In this part, you can set up the system to send a reminder email to website owners when a post expires so that they can check and avoid mistakenly hiding the post. There are 3 email options for email sending. The developer has mentioned the detailed instructions for each of them. Therefore, you can read it and follow all the steps.</p>

<p><img class="aligncenter" src="https://i.imgur.com/aA2Ozjc.png" alt="Edit the notification when the post expired" width="773" height="514" /></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p><strong>Post Footer Display</strong></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Normally, only you could see the expiry dates set for posts. Thus, if you want visitors to know them too (such as expiry dates for candidates to <a href="https://gretathemes.com/wordpress-themes-online-cv/">submit their CV</a> on time), you have to add a notification in the footer. For example, I added one that said: "The promotion will expire at <strong>EXPIRATIONTIME EXPIRATIONDATE.</strong></p>

<p><img class="aligncenter" src="https://imgur.com/LJ34mDl.png" alt="Edit the notification on the footer about the post expiration date" width="699" height="378" /></p>

<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->

<h4>Defaults Tab</h4>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>In this part, there are some optional settings for each post type. Pay attention to these settings:</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p><strong><em>Active</em></strong>: Display a section on the sidebar in the post/page editor to set expiry dates. You should <strong>enable this one as default</strong>.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p><strong>How to expire</strong>: After expiration, your posts/pages will be set to the status that you choose in this part. I will clarify this for you in Step 3.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>That's all for the basic settings you need for Post Expirator plugin. Don't forget to scroll down and click <strong>Save Changes, </strong>by the way.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Besides, because the plugin follows the time settings of your WordPress website, you need to set the website time zone you want by going to <strong>Settings</strong> &gt; <strong>General</strong> &gt; <strong>Time Zone</strong>.</p>

<p><img class="aligncenter" src="https://i.imgur.com/QfnU0uE.png" alt="Change the timezone of the post expiration date" width="848" height="406" /></p>

<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->

<h3><strong>Step 3: Set Expiry Dates for Your Posts</strong></h3>

<!-- /wp:heading -->

<!-- wp:heading {"level":4} -->

<h4>Set a Default Expiration Date for All Pages/Posts</h4>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>You can make all posts/pages recently published on your website to expire after a few days. Go to <strong>Settings </strong>&gt;<strong> Post Expirator</strong> &gt; <strong>General Settings</strong> &gt; <strong>Defaults </strong>&gt; <strong>Default Date/Time Duration </strong> and choose <strong>Custom</strong>.</p>

<p><img class="aligncenter" src="https://i.imgur.com/kCmnpdn.png" alt="Set a Default Expiration Date for All Pages/Posts" width="912" height="514" /></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>After, enter the default expiry date for all posts/pages right after you published them. For example, if you want them to expire after 1 month, 2 weeks, and 8 hours after being posted, go to <strong>Custom</strong> and enter <strong>+1 month 2 week 8 hours</strong>.</p>

<p><img class="aligncenter" src="https://i.imgur.com/xo4us8d.png" alt="enter the default expiry date for all posts/pages in WordPress" width="1333" height="518" /></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>After expiration, your posts/pages will be set to the default status in the <strong>Defaults</strong> tab. You can also change posts/pages to all these statuses below:</p>

<!-- /wp:paragraph -->

<!-- wp:list -->

<ul>

<li><strong>Draft</strong></li>

<li><strong>Delete</strong></li>

<li><strong>Trash</strong></li>

<li><strong>Private</strong></li>

<li><strong>Stick</strong>: pin on top</li>

<li><strong>Unstick</strong>: unpin on top</li>

<li><strong>Category: Replace</strong>: move to other categories</li>

<li><strong>Category: Add</strong>: add to other categories</li>

<li><strong>Category: Remove</strong>: delete from the current category</li>

</ul>

<p><img class="aligncenter" src="https://i.imgur.com/bZ10O7W.png" alt="your pPosts/pages will be set to the default status when they expires" width="713" height="562" /></p>

<!-- /wp:list -->

<!-- wp:heading {"level":4} -->

<h4>Set Expiry Dates for Each Post/Page</h4>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>First, go to the Editor of a post/page you want to expire after X days.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>On the right sidebar, you will see the <strong>Post Expirator </strong>section<strong>. </strong>Tick <strong>Enable Post Expirator</strong> to turn on the expiry date function.</p>

<p><img class="aligncenter" src="https://i.imgur.com/K1FT91i.png" alt="Set Expiry Dates for Each Post/Page" width="1366" height="625" /></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Next, enter the exact date (day/month/year) that the post will be hidden or deleted. Remember that this date follows the time zone you chose in Step 2. Lastly, choose the post/page status after expiration in the <strong>How to expire </strong>section.</p>

<p><img class="aligncenter" src="https://i.imgur.com/deTcOgT.png" alt="Set the status for posts / pages when they expire" width="1366" height="625" /></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Here I set the page status after it expires as <strong>Draft, </strong>so my page will be saved as a draft at 8.00 AM, December 20th, 2020. You can see the result below:</p>

<p><img class="aligncenter" src="https://i.imgur.com/tNngqiF.png" alt="I set the page status after it expires as Draft" width="568" height="370" /></p>

<!-- /wp:paragraph -->

<!-- wp:image -->

<figure class="wp-block-image"></figure>

<!-- /wp:image -->

<!-- wp:paragraph -->

<p>Easy peasy lemon squeezy. All done here!</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>One last thing, keep in mind that Post Expirator plugin always prioritizes <strong>statuses and</strong> <strong>expiry dates</strong> <strong>of each post/page</strong> more than the <strong>default ones </strong>set in the <strong>Defaults</strong> tab.</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>Verdict</h2>

<!-- /wp:heading -->

<p>Setting up expiry dates for posts helps you hide or delete posts after an amount of time effortlessly. This feature is notably helpful for recruitment or flash sale content on websites. For better post managing, you definitely should not miss this feature.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Bonus: you can also use <a href="https://metabox.io/" rel="follow">Meta Box</a> plugin to manually reorder them. <a href="https://metabox.io/manually-reorder-posts-with-meta-box/" rel="follow">Click here</a> for detailed instructions.</p>