How to Optimize Your WordPress for Better Performance
Updated 2 months ago
Here are our top tips for improving WordPress performance and speeding up your site's load time.
100% up-to-date platform
In our experience, updates are the first step before working on a site. It's common to find sites with very outdated plugins or themes, which can potentially cause performance issues and, more importantly, security problems. Our primary focus when keeping our store running smoothly is to keep WordPress, our plugins, and the theme we use 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, this can also cause our site's resource usage to spike—not because of a lack of resources at the server/hosting level, but because we have too many plugins.
Before taking an in-depth look at the resource usage of each of our plugins, it's always a good idea to check that every active plugin serves a necessary purpose that isn't already covered by another active plugin.
WordPress Site Health
WordPress has a built-in tool under Tools > Site Health, which we discussed in detail previously.
This can alert us to PHP settings that need to be adjusted in our hosting plan.
Up-to-date PHP
We recommend using PHP 8.3 or later, always checking that it's 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 isn't 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 up-to-date sites are already compatible with PHP 8.3, and the most recently updated ones already support PHP 8.4, which is the ideal version.
0 PHP errors
With the Query Monitor plugin, we can check for potential PHP errors. If we find «deprecated» errors, it means that the functions in the plugin or theme causing 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 usually costly in terms of performance and may also indicate a problem with your site. You should check both files and make sure that no plugin or theme is generating errors.
Remove PHP settings from the .htaccess file
Using .htaccess allows you to configure PHP in a certain way, but it means PHP has to read this file before it runs.
To improve the performance of all applications on our server, we use the CloudLinux PHP Selector, which lets you configure PHP directly from cPanel without modifying .htaccess to change any settings.
Therefore, we recommend removing any custom PHP settings from your .htaccess file and leaving only the default WordPress content or any other LiteSpeed Cache settings, but no PHP settings.
Check resource usage and errors with Query Monitor
Query Monitor is an excellent, lightweight plugin that helps us check PHP compatibility and view resource usage, processing time, memory usage, and the 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'd like us to take care of making these adjustments, see our WordPress optimization service.