Basic WordPress Hygiene

Database indexes

In the examples we have used the standard wp_ prefix for table names, this may differ between databases.

1. Options table

When the options table is big, it can benefit from having an index on the autoload column.

ALTER TABLE 'wp_options' ADD INDEX ('autoload');

2. Post meta table

The post meta table is actively in use by the ACF (Advanced Custom Fields) plugin, and may result in queries that select data by value. There is no index on this column by default.

ALTER TABLE 'wp_postmeta' ADD INDEX 'sbpmv' ('meta_value'(10));

3. Database maintenance
Check that all tables are InnoDB, if not - convert them (MyISAM are the worst!)
Select all tables in PhpMyAdmin and run Analyse That will fix dirty indexes.
Do this with great care, when load is low: Select all tables and run Optimise all tables. This will clean up and reorganise data in the database.

Cron

WordPress triggers wp-cron all to often on high traffic sites, and it should be configured as a normal cron job on server.

define('DISABLE_WP_CRON', true);

Go to your site's Servebolt admin and set up the cron job to run directly from php:

Time:

*/5 * * * *

Command:

cd /path/to/your/host/public/; /usr/bin/php /path/to/your/host/public/wp-cron.php

Health / Performance Checklist

In WordPress

Make sure there are no plugins that compress content (that will make WordPress PHP compress it, apache pagespeed decompress it and recompress it, and nginx to decompress and compress it). Nginx compresses output automatically for all relevant 

Log Review

Check log files for Errors
Check that there is no extensive logging (wp-logging etc)

.htaccess

Check .htaccess file for directives overriding normal server config (change cache policy, compression etc) 

Amplification requests
Settings on Servebolt - static caching of elements
Was this article helpful?
Thank you!