/WordPress Performance Tip: Controlling Cronjobs

WordPress Performance Tip: Controlling Cronjobs

So, your blog is growing fast or you are worried that your visitors will start increasing quickly but your WordPress based website or blog is slowly starting to slow down. You are panicking and you start to get worried that your rankings will start falling down, visitors will get frustrated at your site and your site might possibly go down.

Well, we are here to give you a simple and quick tip to reduce the resource usage of your WordPress blog while increasing the overall performance due to the decreased load that your blog will generate, all you need is 5 minutes and FTP access to your blog.

The wp-cron.php file runs with every single page load by default on WordPress blogs, which means that for every 1 request you get, you generate another one. This effectively translates to 1000 page views are actually making 2000 requests, which does not make sense!

You see, WordPress was designed to be extremely easy to use, therefore, this easy to use system was put in place under the assumption that it was plug and play, because you never had to worry about it before. However, they assume once your traffic gets busy, you would likely take care of it anyways.

Before we start, make sure that you are comfortable with your using FTP and editing PHP files. Also, you want to always take backups of your website and files before making any changes to always go back if you have any problems.

  1. Disable the wp-cron.php by adding the following line anywhere in your wp-config.php file. You should put this line right after the <?php line.
<?php
define('DISABLE_WP_CRON', true);
?>
  1. Now, we have disabled the wp-cron.php, but some of your plugnis most likely rely on it, not to worry, all you have to do is create a cronjob with the following command.

    wget -q http://mydomain.com/wp-cron.php -O /dev/null

If you are using cPanel, you can look at the documentation on how to create a cronjob right here.

Voila! Your website’s resource usage has effectively been cut in half and now your server will start performing much better overall. We will continue to post quick performance tips from time to time, so make sure to keep up with our blog!

Don’t forget to follow us on Twitter for news, updates and announcements – @vexxhost.

 

Request a Free Trial along with a Free Cloud Strategy Session with our Experts.

Spend 30 minutes with our experts to discuss how to design, migrate and/or architect your cloud solution to help you meet your objectives. Following the expert session, we'll set you up with a free trial that is personally tailored to your needs.

Don't have any questions? Simply let us know and we can skip the expert session.

Contact Us Today
2017-08-16T13:30:44+00:00 March 22nd, 2013|0 Comments

Leave A Comment