How to set up a WordPress cron job

In this article, you will learn how to disabe the WordPress cron job and set an alternative one up via cPanel. By default, the WordPress cron job runs every time someone visits your website which can affect server performance. By configuring this to run in cPanel automatically it can make your website faster as the cron job isn’t running when a visitor first clicks on your website.

How to disable the WordPress cron job (wp-cron.php)

To disable the default virtual WordPress cron job, follow these steps:

  1. Log in to your cPanel account.
  2. Search for File Manager then click it.
  3. Head over to your WordPress installation, Usually public_html.
  4. Find wp-config.php > right click > edit > edit.
  5. Scroll down to the bottom and find /* That’s all, stop editing! Happy publishing. */
  6. Above that line paste the following:
    define(‘DISABLE_WP_CRON’, true);
  7. In the top left press save.
  8. You have now disabled the WordPress cron job file.

Adding disable wp cron to wpconfig. Php file in cpanel conor bradley digital agency

How to create a scheduled cron job

To set up a WordPress cron job using cPanel, follow these steps:

  1. Log in to cPanel.
  2. Search for cron jobs then click it.
  3. Scroll down until you see add a new cron job.
  4.  in the Common Settings dropdown box, select Twice an hour.
  5. In the Command box, paste the following:
    ${HOME}/public_html; /usr/local/bin/php -q wp-cron.php

    You will need to change “public_html” if your WordPress install is elsewhere.
  6. Click Add New Cron Job.
  7. The cron job will run every 30 minutes.
Creating a cron job in cpanel for wordpress cron job conor bradley digital agency

 Facebook | Twitter | Instagram | LinkedIn  | Youtube | Vimeo | Blog | Knowledge Base | Client Area | Google Business