How to disable WP-Cron and set up a cron job in cPanel
WordPress normally runs scheduled tasks (WP-Cron) when someone visits the site. On busy sites this wastes resources; on quiet sites tasks may run late. A real server cron job is more reliable.
Step 1: Disable WP-Cron
Edit wp-config.php and add above /* That's all, stop editing! */:
define( 'DISABLE_WP_CRON', true );
Step 2: Add a cron job
- In cPanel, open Cron Jobs in the Advanced section.
- Under Common Settings, choose Once Per Fifteen Minutes (or every 5 minutes for shops).
- In Command, enter (replacing the path with your own):
cd /home/cpuser/public_html && php wp-cron.php >/dev/null 2>&1
- Click Add New Cron Job.
Using php directly avoids web requests and firewall issues. Your home path is shown in cPanel's General Information panel.
Related Articles
How to enable WP_DEBUG in WordPress
Debug mode shows PHP errors, which helps track down problems. Edit wp-config.php and find define( 'WP_DEBUG', false );. Replace it with: define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); This records ...
How to set up an autoresponder in cPanel
An autoresponder automatically replies to incoming email, for example while you're on holiday. Log in to cPanel and open Autoresponders in the Email section. Click Add Autoresponder. Fill in the details: Interval: how many hours to wait before ...
How to set up a DMARC record in cPanel
DMARC tells receiving mail servers what to do with messages that fail SPF or DKIM checks, and can send you reports. Google, Yahoo and Microsoft now expect a DMARC record from many senders. Set up SPF and DKIM first (see How to add an SPF record). Add ...
How to fix a slow WordPress admin area
Common fixes Update PHP to a current version (see How to change PHP version). This alone often gives the biggest improvement. Remove unused plugins. Deactivating isn't enough; delete them. Find heavy plugins with Query Monitor, which shows how many ...
How to set up Google Workspace email
To receive email in Google Workspace, point your domain's MX records to Google. Step 1: Verify your domain Google gives you a TXT record to prove you own the domain. Add it in cPanel under Zone Editor › Manage › Add Record (type TXT), then click ...