If your posts are not being unpublished at the correct time, this guide will help. Please follow through all the steps to check that your site is ready to unpublish content on schedule.


Step #1. Have you disabled all caching services and plugins? #

Caching plugins and services and the most common cause of problems with PublishPress Future. If posts are not expiring correctly, please test your site with all caching layers disabled.


Step #2. Have you confirmed WP Cron is working on your site? #

By default, PublishPress Future relies on WP Cron to unpublish your content. This post has technical details on how it works.

  • Using WP Cron? Go to “Future” in your WordPress admin menu and then clicking the “Diagnostics” tab. You will see a green check mark if WP Cron is enabled.
  • Check your site's wp-config.php file. Some developers and hosting companies add lines that will disable cron on your site. For example: define(‘DISABLE_WP_CRON’, true);

Step #3. Are cron tasks being created? #

Next, check your cron tasks. PublishPress Future will show whether or not a cron job has been successfully set up for your posts to expire. In the image below, “Cron event scheduled” means that everything is working correctly.

Cron Scheduled
Cron Scheduled

You can confirm this by going to “Future” in your WordPress admin menu and then clicking the “Diagnostics” tab. If you do not see an event called postExpiratorExpire then your unpublishing has not been scheduled correctly.

Cron Schedule
Cron Schedule

Step #4. Are your debug logs accurate? #

PublishPress Future also has a debug option. Go to Future > Diagnostics and click “Enable Debugging”. After you have done that, you will see the logs under Future > View Debug Logs.

Is the information in those logs correct? These logs can be read by non-technical users. For example, the first line in that image shows that a post with the ID of “10” is set to “delete” on “Fri, 03 Sep 2021”.

Debug Log
Debug Log

Step #5. Does an alternative to WP Cron work? #

In some situations, using the normal WP Cron option in the WordPress core is not enough. You may have to use cron task from outside your WordPress site.

First, define a constant in the wp-config.php file

define('DISABLE_WP_CRON', true);

Next, configure a cron job. But this can be done on different ways, depending on the server. The cron job should call this:

wget -q -O - https://mydomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

This can also be done using WP CLI:

wp cron event run --due-now

Step #6. Is the problem with your server? #

  • Test PublishPress Future another site on the same server. If you see the same problem, the issue is with your site. If you don't see the same problem, the issue is with your original site.
  • Test PublishPress Future on a clone of your site but on a different server or local host. If you don't see the same problem, the issue is with your original server.

If you test both of these steps and the issue with the server, please talk to your hosting company about why cron is not running correctly.