Notice: get_the_author_email is deprecated since version 2.8.0! Use get_the_author_meta('email') instead. in /home/onsitewp/public_html/wp-includes/functions.php on line 3831
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);
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.