Overview #
Sometimes the Content Stream and Content Plan generation processes can stop unexpectedly. This is usually due to the fact that the plugin relies on WordPress’ built-in cron system (WP‑Cron), which in turn depends on site traffic. In low-traffic situations or when caching/optimization plugins interfere, scheduled tasks may not run as expected.
Below you will find a detailed explanation of the problem, along with steps to resolve it by setting up a real cron job on your server and adjusting caching settings.
1. Understanding WP‑Cron Limitations #
WordPress uses a pseudo‑cron system (WP‑Cron) that executes scheduled tasks during page loads. On sites with low traffic, WP‑Cron may not run frequently enough, delaying or halting content generation. Additionally, caching and optimization plugins can sometimes block or delay requests to wp‑cron.php.
2. Disabling WP‑Cron and Setting Up a Real Cron Job #
To ensure tasks run reliably, disable WP‑Cron and use a real cron job on your server.
Step 1: Disable WP‑Cron
Edit your wp-config.php
file and add the following line (above the comment “/* That’s all, stop editing! */”):
define('DISABLE_WP_CRON', true);
Step 2: Create a Real Cron Job
Set up a cron job on your server to call the WordPress cron file at regular intervals (for example, every 5 minutes).
If you use cPanel, follow these steps:
- Log in to your hosting control panel and open the “Cron Jobs” section.
- Set the cron schedule to run every 5 minutes with the following command:
*/5 * * * * /usr/bin/php /home/username/public_html/wp-cron.php
Alternatively, you can use wget or curl:
Using wget:
*/5 * * * * wget -q -O /dev/null https://yourdomain.com/wp-cron.php?doing_wp_cron
Using curl:
*/5 * * * * curl --silent https://yourdomain.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
Replace yourdomain.com
with your actual domain and adjust the file path as needed.
Step 3: Verify the Cron Job
Check your hosting panel’s cron logs or error logs to ensure the job is running every 5 minutes. Also, monitor your plugin logs to confirm that tasks are being executed on schedule.
3. Addressing Caching and Optimization Conflicts #
Caching and optimization plugins (e.g., AutoOptimize, WP Rocket, LiteSpeed Cache) may interfere with cron tasks by blocking requests to wp‑cron.php. If you experience intermittent halts:
- Temporarily disable caching/optimization plugins to see if the issue resolves.
- Exclude wp‑cron.php or admin‑ajax requests from caching in your plugin settings.
- Specifically, users have reported issues with AutoOptimize. Consider disabling it temporarily and checking whether content generation resumes normally.
4. Additional Troubleshooting #
Other potential factors include:
- Server Resource Limits:
Your hosting provider may enforce strict CPU or memory limits that kill cron processes. Check your error logs or contact your host for resource details. - SSL or Redirect Issues:
Ensure your cron URL uses the correct protocol (https://) and that no redirection or SSL issues are blocking the request. - PHP Settings:
Check your PHP configuration, especially parameters likemax_execution_time
,memory_limit
, and other performance-related settings. Increase them if necessary.
5. Final Recommendations #
- Use a real cron job set to run every 5 minutes to guarantee scheduled tasks are executed regardless of site traffic.
- Adjust caching settings or temporarily disable optimization plugins if they conflict with WP‑Cron.
- Verify your server’s PHP settings to ensure that processes are not being prematurely terminated.
By following these steps, you can minimize unexpected halts in content generation and maintain a steady flow of content through your Content Stream and Content Plan processes.