Whenever someone visits your website, the wp-cron.php will run. This can be taxing to the server, especially if your website gets a lot of traffic. The cron really only needs to run when you make updates, so disabling its natural behavior to run every time a visitor comes to your website can be helpful in lowering your resource usage on the server.

Turning the wp-cron.php off

Disabling the Cron is easy. This is done by adding a line of code to your wp-config.php file.

  1. Open your wp-config.php file with the code editor in the cPanel File Manager
  2. Add the following line of code to the file:

    define('DISABLE_WP_CRON', 'true');

    The placement of this code in the wp-config file is important, we suggest placing it under the definition of your database settings, as in:

    define('DB_NAME', 'userna5_db');
    /** MySQL database username */
    define('DB_USER', 'userna5_user');
    define('DISABLE_WP_CRON', 'true');

  3. Click Save

At this point, the cron job will never run on the server.

Configuring cPanel to run the Cron

We still want the cron job to run, so we’re going to manually configure the server to run a cron job in cPanel and set the cron job to run every 3 hours. If you’re not updating content more than every 4 to 6 hours, this setting will be fine.

  1. Log into cPanel
  2. Click on the “Cron Job” icon
  3. Scroll down the page to the “Add New Cron Job
  4. Click on the dropdown menu for “Hour:” and set to “Every 3 hours (*/3)
  5. wp-cron9Go to the command field and enter in the following command:

    cd /home/cpusrname/public_html; php -q wp-cron.php

    Keep in mind, you’ll need to replace cpusrname with your actual cpanel username. Also, this is the path to the file. If you’re using an add-on domain, you’ll need to change the path to reflect it

  6. Click “Add New Cron Job

If you need further assistance please feel free to ask a question on our support center.

Like this Article?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm Tim Sisson, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

We've been listening!

2013-02-14 08:49 am
Fixed code error in the code syntax per customer request.
2013-01-17 08:45 am
Change the command from

php -q /home/cpusrname/public_html/wp-cron.php

to

cd /home/cpusrname/public_html; php -q wp-cron.php

The Previous command failed to run outside the directory. Special thanks to our customer Steve or informing us!

Latest Questions

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Ask a Question!
Recent Questions
  1. Live site images still sourced via temp url?
  2. need a backup of my server
  3. New Account - Control Panel Not Available

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!