• 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 votes
Article Rating
How To Copy MySQL GrantsPHP 5.2 in cPanel easy apache 4
You Might Also Like
 
Exploring eBPF: Revolutionizing Network and System Monitoring
 
Nginx Caching for WordPress using fastcgi_cache
Subscribe
Notify of
guest

guest

0 Comments
Inline Feedbacks
View all comments
8 years ago MySQL, Web Hosting, Wordpress Linux Performance Tuning1,034
Recent Posts
  • Configuring Firewalld to Work Seamlessly with Docker on CentOS
  • Mastering NGINX Tuning: Optimizing Web Server Performance
  • Exploring eBPF: Revolutionizing Network and System Monitoring
  • Kubernetes: Installation and Overview on CentOS 8
  • Install Docker on Centos 8
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
76,144 views
Zend Opcache
Setup and Optimize Zend OpCache
47,105 views
Install ffmpeg
FFMpeg Install On CentOS 7
21,675 views
Archives
Email subscription

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

2018 © LinuxAdmin.io
wpDiscuz