How to optimize your WordPress for better performance
Updated last week
Below, we share the main tips to keep in mind to improve WordPress performance and speed up your site's loading time.
100% up-to-date 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 keep WordPress, plugins, and the theme we use 100% up to date.
Fewer plugins, lower resource consumption
WordPress has more than 60,000 plugins available, giving us flexibility and freedom when choosing how to meet our requirements. However, this can also cause our site's resource consumption to skyrocket—not because of a lack of server/hosting resources, but because we have too many plugins.
Before analyzing the resource consumption 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 Health
WordPress has a tool available under Tools > Site Health, which we discussed in detail previously.
This can alert us to PHP settings that are required on our hosting plan.
Updated PHP
We recommend using PHP 8.3 at a minimum, or a later version, always verifying that it 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.3, 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, and 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 and in the wp-admin directory.
PHP errors are usually "expensive" 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 certain way, but it means that PHP must read this file before running.
To improve the performance of all applications on our server, we use the CloudLinux PHP Selector, which allows you to 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 leaving only the default WordPress content or any other LiteSpeed cache configuration—but no PHP configuration values.
Check resource consumption 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 consumption, processing time, memory usage, and number of MySQL queries generated by each page.
If we want to evaluate the resource consumption of a filter or plugin, this plugin is excellent for analyzing and comparing results.
If you would like us to handle these adjustments, please inquire about our WordPress optimization service.