Replace wp-cron with real cronjob

Firstly, you should turn off the default WP-Cron behavior to prevent it from running on page load. For this, access the wp-config.php file located in the root directory of your WordPress site. Just before the "/* That's all, stop editing! Happy publishing. */" comment, insert the line:

define('DISABLE_WP_CRON', true);

After deactivating the WP-Cron, you must establish a manual cron job to regularly invoke the wp-cron.php file. A thirty-minute interval is generally ample for most sites. Proceed by navigating to your hosting account's control panel and locating the Cron Jobs section under Site Tools > Development.

There, you can input the following command to execute it every half hour:

cd /home/customer/www/yourdomain.com/public_html; wp cron event run --due-now >/dev/null 2>&1

Do not forget to switch out "/home/customer/www/yourdomain.com/public_html" with the real directory path where your WordPress is installed. If you prefer to get email feedback after each cron run, simply remove ">/dev/null 2>&1" from the end of the command.

Often, the cron job interface will have preset common intervals. In this case, you can select the option for "Twice Per Hour" from the provided interval options instead of manually entering the schedule.

  • wp-cli
  • 0 用戶發現這個有用
這篇文章有幫助嗎?

相關文章

Categories and tags have vanished

The problem ended up being that system alerts had caused certain functions to shut down. One of...

Leverage Browser Caching

<IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 month"...

How to deactivate all plugins when not able to access the administrative menus?

Sometimes it may be necessary to deactivate all plugins, but you can't access the administrative...

How to Move a WordPress Website from HTTP to HTTPS/SSL

Configuring WordPress for SSL/HTTPS Links in WordPress (such as image attachments, themes CSS...

WordPress Security - Base64 and eval

WordFence has a scanner that can find base64 and eval code. You can use CPANEL file manager to...