cPanel: Disable WP-Cron

WordPress uses a built-in scheduling system called wp-cron to handle time-sensitive tasks like publishing scheduled posts, checking for updates, and sending emails.
However, wp-cron is triggered by site visits, which can lead to performance issues on high-traffic sites or missed tasks on low-traffic sites.
Disabling wp-cron and using a server-level cron job can improve reliability and performance.

Steps to Disable wp-cron
1. Access your wp-config.php file:
- Use an FTP client or cPanel's file manager to navigate to the root directory of your WordPress installation.
- Locate the wp-config.php file.

2. Edit the wp-config.php file:
- Download the wp-config.php file to your computer and open it in a text editor.
- Add the following line of code just before the line that says, "That's all, stop editing! Happy blogging":

define('DISABLE_WP_CRON', true);

3. Save the changes and upload the file back to your server.

Setting Up a Proper Cron Job
After disabling wp-cron, you need to set up a server-level cron job to handle scheduled tasks.

1. Log in to your cPanel (EG. http://yourdomain.com/cpanel)
2. In the "Advanced" section, click Cron Jobs icon
3. In the "Add New Cron Job" section:

Common Settings: [Set the desired frequency (e.g., every 15 minutes)]
Command: /usr/bin/php /home/username/public_html/wp-cron.php
* Replace username with your actual hosting username

4. Click Add New Cron Job to save the changes.

  • 0 Utilizadores acharam útil
Esta resposta foi útil?

Artigos Relacionados

Change WordPress admin password

If you lost your WordPress admin password, there are 3 methods you may try to reset them.You may...

Configuration for WP Mail SMTP Plugin

Sending mail through scripts will require SMTP authentication. In order to be able to send mails...

Install WordPress using Softaculous

Softaculous is available in cPanel and DirectAdmin control panel.Please follow the steps below to...

Change and hide WordPress admin URL

There will always be brute force attack on your WordPress site no matter how strong or reliable...

How to install WordPress manually

For Linux  hosting platform inside cPanel and DirectAdmin, there is a script installer named...