Slow WordPress site, why it is slow and which PHP and cache settings help

On a slow WordPress site, first measure the server response time (TTFB) with GTmetrix or Google PageSpeed Insights. If TTFB is low, the server responds quickly and the delay comes from the weight of the page, meaning images, scripts and plugins. If TTFB is high, start with the PHP settings, the cache and the plugins described below.

How do I measure website speed with GTmetrix and PageSpeed Insights

Run your site's address through GTmetrix and PageSpeed Insights. Look at two values:

  • TTFB (Time to First Byte). How quickly the server answers the first request. A value below roughly 0.8 seconds is considered good. With page cache enabled, the value usually drops well below that.
  • LCP (Largest Contentful Paint). When the largest element of the page appears, usually a large image or a slider. It is one of Google's Core Web Vitals and a good value is up to 2.5 seconds.

If TTFB is low but LCP is high, the server has done its job. The page is slow because it downloads many heavy files. In that case see the section on page weight.

PageSpeed Insights measures mobile by simulating a slow network and a slow processor. That is why the mobile score is always lower than desktop. The issues it lists, such as render-blocking resources, unused JavaScript and CSS, offscreen images and third-party scripts, concern the page and not the server.

Which PHP settings help

All settings are made from PHP Selector, in cPanel > Software > Select PHP Version. You will find detailed steps in the guide to changing the PHP version with PHP Selector.

  1. PHP version. Choose the newest version your theme and plugins support and click Set as current. WordPress recommends PHP 8.3 or newer. At Konet, versions up to 8.5 are available. After the change, check the site and the dashboard.
  2. Extensions. On the Extensions tab make sure opcache and imagick are ticked. OPcache keeps PHP code ready in memory and speeds up every page. If you will use object cache, also tick redis or memcached.
  3. memory_limit. On the Options tab. For most WordPress sites 256M is enough, which is also WooCommerce's recommendation. A very heavy shop with many plugins may need 512M. If the value is lower than 256M, increase it. memory_limit is only an upper limit, so a higher value does not make the site faster. It only helps when the site stops with a memory error.
  4. Lower values in other files. Open the .htaccess file in the site's folder with File Manager. If you find a line such as php_value memory_limit 128M, delete it or comment it out with a # in front. The .htaccess line takes precedence over the setting in Options. The php.ini and .user.ini files do not apply on our servers. See more about PHP settings through .htaccess.

The PHP version is set only from Select PHP Version. In MultiPHP Manager, domains must be set to inherit. See why we don't use MultiPHP Manager.

Which cache should I use, LiteSpeed Cache and object cache

Konet's servers run LiteSpeed, so the most efficient solution is the LiteSpeed Cache plugin.

  • Page cache. Install and activate LiteSpeed Cache. The server cache is already active, see the LiteSpeed Web Cache Manager.
  • Object cache. It stores database results in memory and helps a lot in shops and in the dashboard. At Konet, Redis and Memcached are available on all plans. For setup see Redis Object Cache in LiteSpeed Cache or enabling Memcached.
  • One cache plugin only. Don't keep two cache plugins active together. AccelerateWP is an alternative option, not an add-on. It does not work if another caching plugin is present.

On a shop, avoid the JS Combine option of LiteSpeed Cache. It keeps creating new JavaScript files and fills up the account's disk space. JS Minify and Load JS Deferred don't have this problem.

Speed up WordPress, how do I reduce page weight

  • Images. Upload images at the size they are displayed and convert them to WebP images. LiteSpeed Cache does this from LiteSpeed Cache > Image Optimization. Enable lazy load for images below the first screen, but not for the main image on the home page.
  • Fewer and lighter plugins. Deactivate and delete the ones you don't use. If two plugins do the same job, keep one.
  • Fonts. Load Google Fonts locally, from your own server. Many themes have an option for this.
  • External scripts. Every tracker, chat, pixel or social widget adds requests to other servers. Keep only the ones you really need.
  • Theme. Heavy page builders and sliders on the home page raise LCP a lot. A lightweight theme makes a big difference on mobile.

How do I find exactly what is slowing it down

CloudLinux's X-Ray App is available in cPanel on all Konet plans. It monitors requests to a page and shows which plugin, which database query or which external call is slow. You start with Start Tracing for your domain. See the X-Ray App guide.

To see whether the site reaches the plan's limits, open cPanel > Metrics > Resource Usage. It shows CPU, RAM and process usage. If after all the improvements you often hit the limits, see when you need a plan upgrade.

Frequently Asked Questions

I get "Allowed memory size of 134217728 bytes exhausted", what does it mean?
The site reached a memory limit of 128 MB. In Select PHP Version > Options set memory_limit to 256M. Also check whether there is a php_value memory_limit line in .htaccess and whether the domain is set to inherit in MultiPHP Manager, because these can keep a lower value.

My developer says the server needs more RAM. Is that true?
First look at TTFB and Resource Usage. If TTFB is low and the limits are not reached, more RAM will not make the page faster. If the limits are reached often, a bigger plan helps.

Why is my WordPress slow even though I installed a cache plugin?
Page cache does not cover the dashboard, the cart or pages for logged-in users. Object cache helps there. If visitor pages are slow too, check that two cache plugins are not running together and that some plugin is not purging the cache all the time. Also check whether a plugin sends a PHPSESSID cookie on every page, because then the cache does not serve the pages.

Should I remove Wordfence to make the site faster?
No. Konet recommends using Wordfence. Keep only one security plugin, though, not two or three together.

Can I enable the LiteSpeed Cache crawler?
At Konet the crawler is off by default, because it puts load on the server. It is enabled by ticket on every hosting plan except Web Hosting Light, as explained in the article on the LiteSpeed crawler showing as disabled. Page cache works normally without it, the first visit to each page simply creates the cached copy.

Why does PageSpeed give a low mobile score when the site opens quickly?
PageSpeed simulates a slow phone and a slow network. Focus mainly on what it reports about images and scripts, not only on the score.

Can Konet do the optimizations for me?
Hosting support covers the server and the cPanel settings, not the application. See what hosting support covers.

Was this article helpful?

Related service Konet Web Hosting cPanel, LiteSpeed and automatic backups: 24 every 2 hours for 48 hours, then 6 daily, 4 weekly and 3 monthly.