How to Optimize Your WordPress for Better Performance
Updated last month
Below, we share the main tips to keep in mind to improve WordPress performance and speed up your site's loading time.
100% updated platform
In our experience, updates are the first step before working on a site. It is common to find sites with very outdated plugins or themes, potentially causing performance issues and, more importantly, security problems. Our primary focus when keeping our store running smoothly is to ensure that WordPress, our plugins, and the theme we use are 100% up to date.
Fewer plugins, lower resource usage
WordPress has more than 60,000 plugins available, giving us flexibility and freedom when choosing how to meet our requirements. However, they can also cause our site's resource usage to skyrocket—not because of a lack of resources at the server/hosting level, but because we have too many plugins.
Before analyzing the resource usage of each of our plugins in depth, it is always a good idea to verify that every activated plugin performs a necessary function that is not already included in another active plugin.
WordPress Site Health
WordPress has a tool available under the Tools > Site Health menu, which we discussed in detail previously.
This can alert us to PHP settings that need to be adjusted in our hosting plan.
Updated PHP
We recommend using PHP version 8.2 at a minimum and checking whether PHP 8.3 is compatible with our plugins and chosen theme. In our PHP configuration guide, we explain how to change the version and adjust its variables.
If one of your plugins or themes is not compatible with PHP 8.2, it may be worth considering a replacement, since it will receive security support until the end of the year.
In our experience, most updated sites are already compatible with PHP 8.3, while the most up-to-date ones already support PHP 8.4, which is the ideal version.
0 PHP errors
With the Query Monitor plugin, we can identify potential PHP errors. If we find "deprecated" errors, it means that the functions used by the plugin or theme generating the error may be discontinued in PHP 8 versions.
We also recommend checking the error_log file in the root directory where WordPress is installed, as well as in the wp-admin directory.
PHP errors are often "costly" in terms of performance, in addition to potentially indicating a problem with your site. You should check both files and make sure that no plugin or theme generates errors.
Remove PHP settings from the .htaccess file
Using .htaccess allows PHP to be configured in a specific way, but it requires PHP to read this file before running.
To improve the performance of all applications on our server, we use the CloudLinux PHP Selector, which lets you configure PHP directly from your cPanel without having to modify .htaccess to change any configuration value.
Therefore, we recommend removing any custom PHP configuration from your .htaccess and keeping only the default WordPress content or any other LiteSpeed Cache configuration—but no PHP configuration values.
Check resource usage and errors with Query Monitor
Query Monitor is an excellent, lightweight plugin that, in addition to helping us check PHP compatibility, lets us view the resource usage, processing time, memory usage, and number of MySQL queries generated by each page.
If we want to evaluate the resource usage of a filter or plugin, this plugin is excellent for analyzing and comparing results.
If you would like us to handle these adjustments, please contact us about our WordPress optimization service.