+1 775 273-8885

How to eliminate Memory and CPU problems caused by WP-Cron

It is possible to use WordPress for years and not know what WP-Cron is until the day you check your server logs and realize that a process called WP-Cron.php is using up your memory and CPU.

Let’s start by understanding what WP-Cron.php is:

WP-Cron is a script within the WordPress core that takes care of periodical maintenance tasks such as scheduling posts to go live at a future date, and for running Akismet’s spam filter.

If you own a WordPress site that doesn’t have much visitors or has a small number of pages/posts, you will not necessarily notice any problem with WP-Cron.php. However, if you have thousands of page views an hour and have hundreds of pages/posts, you might have an issue with WP-Cron.php and this is mostly because WP-cron.php will run as many times as the number of page views and site activity that you have in a day by default.

While WP-Cron.php is at the core of your WordPress installation, it can however be controlled to only work at certain intervals instead of working at will. This is exactly what you need to do to ensure that it doesn’t use up your CPU and Memory allocation.

Follow the steps numbered below to have your WP-Cron.php run at specifically defined intervals.

  1. Login to your cPanel
  2. Click on the file manager option
  3. Select the wp-config.php and click on edit file
  4. Insert the following code right after the first line “define(‘DISABLE_WP_CRON’, true);“
  5. Save the file and exit
  6. Go to your cron access on your site and create a new cron job
  7. Enter the following line as the cron command “/usr/bin/wget -O /dev/null http://www.mydomain.com/wp-cron.php?doing_wp_cron”, replacing www.mydomain.com with your site domain
  8. Set the cron to run once a day if you don’t have much traffic and say every two to four hours if you have lots of traffic

If you do not understand any of the steps below, I will advise you get through to your web administrator to help you with the task as not understanding this steps means that you lack the technical know-how to complete the fix.

How to eliminate Memory and CPU problems caused by WP-Cron
How to eliminate Memory and CPU problems caused by WP-Cron
It is possible to use WordPress for years and not know what WP-Cron.php is until the day you check your server logs and see it's hogging your sites resources.
SpectroHost
SpectroHost Blog
Spectro Host
https://www.spectrohost.com/wp-content/uploads/2016/09/sh-logo.png
Post has 2 comments
  • Gage Posted April 9, 2017 in 11:03 am Reply

    Great post.
    If you’re on a shared host that cron job service is crap, you can be found a list of free online cron jobs services at: http://www.cronjobservices.com.

    • Spectro Host Support Posted April 18, 2017 in 9:03 am Reply

      Thanks Gage for your input.

      We’ve had clients switch from wp-cron to our local cron service and so far so good no complaints.
      You can give our hosting service a try. We deliver performance based hosting.

Leave a Reply

Your email address will not be published. Required fields are marked *

FLAT 25% OFF

Copy this code and use upon checkout:

566XNVEWYD
Order Web Hosting Now
* Terms & Conditions Apply
We utilize browser cookies to track activity from users visiting SpectroHost.com.  This way we can offer the best deals and services for each user.  By continuing to browse SpectroHost.com you agree to allow cookies tracking your browsing activity on our site as well as present offers via social media marketing.