• Home
  • About Us
  • Contact
  • Privacy Policy

LinuxAdmin.io

  • Home
  • Tutorials
    • System Administration
    • Linux Tutorials
    • Web Hosting
    • WordPress
    • Virtualization
    • Troubleshooting
    • OpenStack

Disable WordPress Crontab and Run it Manually

By default WordPress runs wp-cron.php every time  someone visits your site. This causes increased load on the server each time a page is requested. On low traffic sites this really isnt noticeable but on higher traffic sites this can become problematic and cause increased load and resource consumption on the server.

Turn off the WordPress Crontab

SSH to the server and go to the base install path of your install.

Open wp-config.php and add the following line to the bottom of the file

define('DISABLE_WP_CRON', 'true');

After saving the file, wordpress will no longer execute the crontab each time a new request for a page is issued.

Add a Manaul Crontab

edit the user crontab by typing

crontab -e

and add the following line:

15 * * * * /path/to/php /path/to/wordpress/wp-cron.php

You will want to  substitute in the following:

/path/to/php with the path to binary php. You can find this by doing

# which php
 /usr/local/sbin/php

/path/to/wordpress/ with the full path to your  install.

The crontab can be scheduled on how often you want it to run. Its currently setup to run once an hour on the 15 minute increment.  It could alternatively be scheduling using a wget or curl method as well.

Apr 18, 2017LinuxAdmin.io
0 0 vote
Article Rating
How To Copy MySQL GrantsPHP 5.2 in cPanel easy apache 4
You Might Also Like
 
MariaDB 10 Upgrade From MySQL 5.1 on CentOS 6
 
Setup and Optimize Zend OpCache
Subscribe
Notify of
guest
guest
0 Comments
Inline Feedbacks
View all comments
6 years ago MySQL, Web Hosting, Wordpress Linux Performance Tuning700
Recent Posts
  • Laravel Installation Guide For CentOS
  • Openstack Services Explanation And Overview
  • OSSEC Intrusion Detection Installation On Centos 7
  • Configure ProFTPd for SFTP on CentOS
  • How To Check And Repair MyISAM Tables In MySQL
Most Commented
Hot Clone Linux Server with Rsync
Hot Clone A CentOS Server With Rsync
14 Comments
ngx_cache_purge module
Install The ngx_cache_purge Module In Nginx
8 Comments
piwik-nginx
Piwik Analytics on Nginx
8 Comments
Tags
linuxcentosLinux Performance Tuningsysadminkvmnetworkingmemcachedanalyticssystemd
About

We love Linux and are dedicated to creating Linux administration tutorials for System Administrators since 2016.

Most Viewed
Default Gateway
How To Configure A Default Gateway on CentOS
62,983 views
Zend Opcache
Setup and Optimize Zend OpCache
46,714 views
Install ffmpeg
FFMpeg Install On CentOS 7
20,909 views
Archives
Email subscription

Sign up for our newsletter to receive the latest news and event postings.

2018 © LinuxAdmin.io
wpDiscuz