There are several improvements that can be done to optimize WordPress for large sites.
Use The System Cron
WordPress has a task scheduler called wp-cron. It checks if tasks are ready to be run on each page hit. This is overkill. We can have the operating system cron system run wp-cron to lessen the tasks done for each page hit.
It’s a 2 step process. First setup your system cron to call wp-cron.php, then configure wordpress not to run wp-cron for page hits.
I set mine to run every 5 minutes. This should be plenty for most people:
*/5 * * * * wget https://www.example.com/wp-cron.php
Then add this line to your wp-config.php:
PostMeta Database Caching
Check if you have wp_postmeta meta_key’s larger than 191:
SELECT MAX(LENGTH(meta_key)) FROM wp_postmeta;
(adjust for different wp_ prefix values or multisite tables)
If it’s below 191, then alter the table:
ALTER TABLE wp_postmeta MODIFY meta_key varchar(191);
Install the Heartbeat Control plugin. Limit the heartbeat to only run on pages/posts in 60 second intervals.
The WP Disable plugin has a long list of fluff that it will disable. Emojis, gravitars, etc.
Author: Brian Murphy
Brian Murphy is co-founder of OnSiteWP, a WordPress website maintenance company. His professional experience of working within enterprise IT, communication departments, startup companies and freelancing provides a unique, well rounded perspective on the issues business owners face.