Some problems are first world problems. Other problems are big WordPress problems.
We deal with some big WordPress customers, and often their sites can become slow. There’s sometimes a myth floating around that “WordPress doesn’t scale” or, more specifically, that “WooCommerce doesn’t scale” but there’s a reason I call this a myth… because it isn’t necessarily true.
There are, however, some things that big WordPress, and in particular, big WooCommerce, doesn’t do well without some minor customisations.
Now, before I get into the meat and bones of what I’m talking about (which is essentially 2-3 tactics I always start with to attempt to speed up a slow big WordPress/ WooCommerce website) I’m going to say one thing: slowness is almost always hosting related.
If you are trying to host a 50,000 product WooCommerce store on $2 GoDaddy hosting, you are going to have a bad time. So, advice number one: don’t do that. Get the biggest and best hosting you can afford. Seriously. If you cannot afford $50 a month for a reasonable slice, then you will probably struggle to maintain the rest of the necessary infrastructure to run a 50,000 product store.
That might feel like an arrogant statement, but it is a broadly brushed fact, based on a lot of experience. Your hosting is not the place to shave costs, if you are a web based business like an e-commerce website!
Method 1 – Reduce WP_Options database size
Having a large WP_options table in your database is often what slows down admin loading times. Getting someone who knows what they are doing to remove unused (aka orphaned) options from your wp_options db table can have a significant performance increase. If you’re still using a plugin which has peppered options in here, consider un-using it!
Method 2 – Add an Index to wp_options database on autoload
More specifically, WordPress looks for “autoload” options in admin. If admin is slow, then sometimes speed improvements can be made by adding an index to the wp_options table.
There’s a full thread on this at WordPress trac here.
To do the TLDR, the following SQL command on your WP MySQL db can speed things up (backup first, backup often, backup!!):
CREATE INDEX autoload ON wp_options(autoload, option_name);
This needs to be tested in your setup to see if improvements indeed occur.
Method 3 – Big Postmeta – make wp_postmeta varchar(191)
This is another one which is more WooCommerce specific, but also will apply to sites with lots of post meta (custom fields) so maybe if you have a big site that uses ACF (Advanced Custom Fields) or similar, you will want to try this in your staging site to speed up admin and logged in user accesses to the site.
WordPress by default has postmeta stored in a larger amount than is always necessary.
Running this command on the WordPress MySQL db can make the admin load faster on sites with lots of post meta:
ALTER TABLE wp_postmeta MODIFY meta_key varchar(191);
You definitely must check if you have post_meta that is longer than 190 chars before doing this (and fix those if you do) and also backup your db first – or at least this table.
The thread on this one is found here.
The above queries can often speed up WordPress performance significantly, allowing it to scale successfully to xxx,000 posts, products or custom post types.
There are further context specific customisations which may also help. For those, please contact us.