How to optimize WordPress and make it faster?
The most common question we are asked regarding WordPress is: "How can I optimize WordPress to make it faster?".
The following are some steps that will help you achieve a faster WordPress website:
Caching
When a visitor visits your WordPress website, the PHP frontend makes a call to the database for more info. Depending on how many plugins you have installed and other factors, this overhead can slow down your website significantly.
Caching creates static web pages for your most viewed content and does not need to access the database and therefore minimizes that overhead.
Since we use LiteSpeed Web Server, WordPress users can easily install the LiteSpeed LSCache WordPress plugin:
https://wordpress.org/plugins/litespeed-cache/
Note: There are several other well known caching plugins available and we cannot suggest any of them as they tend to cause more overhead than they help minimize. So the use of other caching plugins is not recommended in our hosting environment.
Object Caching
You can further speedup your WordPress by using object caching in the LiteSpeed LSCache WordPress plugin. Object caching stores database queries for quicker access. Database queries are then served from cache instead of accessing the database and therefore minimizing overhead.
To enable object caching:
Choose the object cache method you would like to use (Memcached or Redis) and enable the preferred PHP module in "Select PHP Version" in your cPanel or DirectAdmin control panel.
Once you have the preferred PHP module enabled you can enable object caching in the LiteSpeed plugin in WordPress in the "Object" tab.
Click "On", Click the preferred method and then click "Save Changes" at the bottom.
Note: When enabling any type of cache it can take time to build the cache, so it may take a few minutes to notice any speed improvements.
MySQL Indexes/Keys
By default, WordPress does not do a very good job at optimizing the database structure. As your WordPress websites grow, this lack of optimization can begin to slow down your WordPress websites when performing searches, selecting categories, authors, etc.
To help with this, you can use the following plugin to create indexes/keys for you automatically, which increase the speed of lookups in your WordPress database:
https://wordpress.org/plugins/index-wp-mysql-for-speed/
Further speed improvements
Minimize plugin usage - Plugins can be convenient and easy to install, but a lot of plugins available are poorly coded and can cause your WordPress website to become slow, so keeping the amount of installed plugins to a minimum is best.
Themes - Like plugins, themes can also be poorly coded as well as bloated with additional code which can also slow down your WordPress website. Choosing a theme that is visually pleasing as well as optimal can be quite a task.