Troubleshooting in PublishPress Future
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. Disable all caching plugins and options
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. Check that 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:
Step #3. Check that cron tasks are 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.
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.
Step #4. Check your debug logs
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”.
Step #5. Use an alternative to WP Cron
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
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