Direct Answer: Why Use an External Cron Job for WordPress Scheduled Posts?
WordPress’s default scheduling system, known as WP-Cron, relies on site visits to trigger scheduled tasks like publishing posts. For low-traffic sites, this often leads to missed or delayed scheduled posts because there may be no visitors at the scheduled time to initiate WP-Cron. Setting up an external cron job on your server to run the WordPress cron script at regular intervals solves this problem by running scheduled tasks independently of site traffic, ensuring timely post publication.
Prerequisites and Safety Checks Before Making Changes
- Access to Hosting Control Panel or Terminal: You’ll need SSH or cPanel (or similar) access to set up cron jobs.
- Backup Your WordPress Site: Before modifying cron behavior, back up your WordPress files and database. This protects you from potential issues.
- Verify Scheduled Posts Setup: Confirm that your scheduled posts have future publish dates and correct timezone settings in
Settings > General. - Check for Conflicting Plugins: Some plugins modify cron behavior. Temporarily disable caching or optimization plugins to avoid interference during setup.
- Understand Your Server Environment: Know whether you have Linux-based hosting (which supports standard cron jobs) or Windows hosting (which uses Task Scheduler or alternative).
Step-by-Step Instructions for Setting Up External Cron Jobs
1. Disable WP-Cron in WordPress
First, disable the default WP-Cron system so that it doesn’t trigger on every page load.
/*
* Add this line inside your wp-config.php file, above the line that says "That's all, stop editing!"
*/
define('DISABLE_WP_CRON', true);
This prevents WP-Cron from running during normal visitor requests.
2. Create an External Cron Job on the Server
Access your hosting control panel or connect to your server via SSH to create a scheduled task.
Example cron command to run WP-Cron every 15 minutes:
*/15 * * * * wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Or use curl for a quieter request:
*/15 * * * * curl -s https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Explanation:
*/15 * * * *runs the command every 15 minutes.wget/curlrequests the wp-cron.php file, triggering scheduled tasks.- Redirecting output to
/dev/nullsuppresses emails and logs.
3. Use the Correct URL and Verify HTTPS
Replace yourdomain.com with your actual domain. Make sure to specify the correct protocol (http or https) that your site uses to avoid redirect delays.
4. Adjust Cron Frequency for Your Needs
Popular intervals include every 5, 10, or 15 minutes. More frequent execution reduces the delay for scheduled posts but increases server load slightly.
5. Save and Test the Cron Job
- If your hosting panel has a cron job interface, add the task and save it.
- If using SSH, run
crontab -eto edit your cron jobs and paste the command above. - Save and exit the editor.
How to Verify Your Setup Works Correctly

- Schedule a Post: Create a test post scheduled for 10-15 minutes in the future.
- Wait for the Cron Interval: Wait for the external cron job to run once after the scheduled publish time.
- Confirm the Post Published: Visit your site or admin panel to confirm the post status is “Published” and visible to visitors.
- Check Error Logs: Verify your server error logs or WordPress debug logs to ensure no errors appeared during cron execution.
- Optional – Trigger Cron Manually: In a browser, access
https://yourdomain.com/wp-cron.php?doing_wp_cronand verify the server responds with HTTP 200 status.
Common Mistakes and Troubleshooting Tips
- Not Disabling WP-Cron: Failing to disable WP-Cron causes duplicate cron jobs to run, resulting in unexpected behavior.
- Incorrect Cron URL: Using HTTP instead of HTTPS or an incorrect domain can cause requests to fail.
- Cron Too Sparse or Too Frequent: Scheduling the job to run too infrequently (hourly or more) risks further delays; too frequent may use excess resources.
- Firewall Blocks Requests: Ensure your server accepts internal requests to wp-cron.php externally from the cron job.
- Plugin Conflicts: Some plugins modify the WP-Cron system; check plugin documentation for compatibility with external cron jobs.
- Timezone Issues: Confirm your WordPress timezone matches your server and scheduled post times.
Useful Alternatives to External Cron Jobs
- Use WP-Cron Control Plugins: Plugins like “WP Control” enable you to manage and run cron events manually from the dashboard.
- Use a Third-Party Cron Service: Services such as EasyCron or Cronitor can trigger your wp-cron.php URL on schedule.
- Direct PHP Cron Job: Instead of invoking wp-cron.php via HTTP, a cron job can run a PHP script that calls WordPress cron programmatically, though this requires more technical knowledge.
FAQ
Q: Can I keep WP-Cron enabled and also use an external cron job?
A: It’s possible, but not recommended. It can lead to overlapping cron executions, which may cause performance issues or duplicate tasks. Usually, disabling WP-Cron is best when using an external job.
Q: How do I find out if my WordPress site is successfully running WP-Cron?
A: You can check scheduled tasks using plugins like WP Crontrol or by checking your server logs for calls to wp-cron.php.
Q: Why do scheduled posts sometimes miss their schedule even with WP-Cron?
A: WP-Cron depends on site traffic to trigger, so if your site has very low or zero visits at the scheduled time, the task won’t run until the next visit, causing delays.
Q: Can I manually run WP-Cron from the command line?
A: Yes. You can invoke wp cron event run --due-now using WP-CLI if installed, which triggers all due cron events.
Q: Will setting up an external cron job affect my site’s performance?
A: Properly configured, external cron jobs run quickly and have minimal impact. Running it every 15 minutes is typically safe even on shared hosting.
Screenshot Suggestions

- Screenshot of the wp-config.php file open in a code editor showing the DISABLE_WP_CRON line added.
- Screenshot of the hosting control panel’s cron job scheduling interface with the curl/wget cron command entered and frequency set.
- Screenshot from WordPress admin showing a scheduled post being created and its scheduled publish time set.
- Screenshot of the plugin WP Crontrol displaying scheduled cron events to verify they are being executed.
Troubleshooting Edge Cases When Using External Cron Jobs
WP-Cron Not Firing Despite External Cron Job Setup
If you’ve configured the external cron job correctly but scheduled posts still do not publish on time, consider the following diagnoses:
- Check if DISABLE_WP_CRON is Defined Properly: Ensure the line
define('DISABLE_WP_CRON', true);is placed above the/* That's all, stop editing! */line inwp-config.php. Typographical errors or misplaced code may cause WP-Cron to remain enabled. - Validate the External Cron URL is Correct and Reachable: Test the cron URL manually in a browser or via command line with
curlto check for a HTTP 200 response. Redirects, authentication requirements, or SSL issues can prevent successful execution. - Server Firewalls or Security Plugins Blocking Requests: Some security setups block local HTTP requests or requests from cron jobs. Temporarily disable security plugins or allowlist cron job IPs if possible.
- PHP Execution Time or Memory Limits: If your cron tasks are large or your external cron runs multiple events, they can timeout. Increase memory limits or max execution time in
php.inior viaini_set.
Issues Publishing Scheduled Posts Due to Timezone Mismatch
WordPress schedules posts using the timezone set in Settings > General. If your server and WordPress are on different timezones, posts may publish unexpectedly.
- Verify WordPress Timezone: Check your WordPress timezone and confirm it matches your intended publishing times.
- Server Timezone Setting: SSH into your server and run
dateto check server time and timezone. If they differ, consider synchronizing or accounting for offsets.
Advanced Verification Techniques
Using WP-CLI to Monitor and Run Cron Events
If you have SSH access and WP-CLI installed, you can manage cron events directly:
- List all scheduled cron events:
wp cron event list - Run all due cron events immediately:
wp cron event run --due-now - Check if your scheduled post publishing events appear in the list and their schedule.
This is useful when testing or debugging cron issues without waiting for the actual scheduled run.
Check WordPress Cron Logs
By default, WP-Cron does not log its activity. To verify cron execution history:
- Install and activate the WP Crontrol plugin which provides a cron event log.
- Enable debugging in
wp-config.phpby settingdefine('WP_DEBUG', true);anddefine('WP_DEBUG_LOG', true);to log errors. - Monitor the
wp-content/debug.logfile for cron-related errors.
Manual Execution of WordPress Cron for Testing
Sometimes it’s helpful to run your cron tasks manually to verify operation:
- Access your server via SSH.
- Run the command:
curl -s https://yourdomain.com/wp-cron.php?doing_wp_cronand confirm it returns HTML or HTTP 200 status. - Alternatively, use WP-CLI:
wp cron event run --due-nowto process all queued tasks immediately. - Check your scheduled post status after running these commands.
Frequently Asked Questions (Extended)
Q: How do I reduce server load when using frequent cron runs?
Reduce the frequency of the external cron job to every 15 or 30 minutes if your site grows and starts to experience performance issues. Alternatively, optimize your WordPress installation and plugins to minimize cron execution time. Consider queuing intensive tasks asynchronously or offloading them to background job runners.
Q: What if my hosting provider does not offer cron job access?
If cron jobs are not available on your hosting service, you can use third-party cron services like EasyCron or Cronhub. These services call your wp-cron.php URL on your specified schedule remotely, effectively substituting server cron.
Q: Can I restrict access to WP-Cron URL for security?
Yes, you can restrict wp-cron.php access so that only your server or authorized IPs can trigger it, enhancing security against abuse:
- Use .htaccess rules or web server configuration to allow only specific IPs.
- Add secret query parameters to
wp-cron.phpand configure external cron jobs to include them. - Monitor access logs for unusual requests.
Q: I have a large number of scheduled posts; how do I prevent cron overlapping?
Long-running cron events can overlap if scheduled too frequently, causing server load spikes. Use WP Crontrol to space out events and limit them to reasonable batch sizes. You can also configure one-off WP Cron events or hook into background task libraries like Action Scheduler for better management.
Summary of Best Practices
| Step | Recommendation | Why It Matters |
|---|---|---|
| Disable WP-Cron | Use define('DISABLE_WP_CRON', true); | Prevents double execution and ensures control over cron timing |
| Set Up External Cron Every 15 Minutes | Using wget or curl calls to wp-cron.php | Balances timely post publishing with server load |
| Use HTTPS in Cron URL | Ensure SSL certificate is valid and URL matches site | Avoids redirect overhead and potential failures |
| Test Scheduled Posts Publishing | Schedule a test post and confirm it publishes on time | Verifies cron job functionality end-to-end |
| Monitor Logs and Errors | Enable WordPress debugging and check logs periodically | Early detection of cron issues or conflicts |


