Some of the websites we inherit from new clients suffer from slow loading. Out of the box, WordPress is fast. A default WordPress installation without any added extras scores high on GTMetrix. But, when you add themes, plugins, and content, the website slows down considerably. Today, a website must load within 3-4 seconds or visitors will leave your website. Read on to discover how to tweak WordPress to increase the speed of your website.

Several words of caution before digging into how to tweak WordPress. Most of these recommendations are technical and require manually editing code files. If you are not comfortable doing this, the seek the help of a professional WordPress developer. Some online articles jump right into recommending adding plugins for this and plugins for that. Each added plugin you install tends to slow down a WordPress website, especially if they are poorly coded. We always look to other solutions before adding plugins. We use a local offline server for testing changes. Finally, always create a backup before changing any code in any WordPress files.

Add GZIP compression

Most web browsers today accept compressed files. The web hosting server compresses files and sends them to the web browser. GZIP compression uses several algorithms to remove unneeded items from a file. Typical compression can reduce a file to one third its original size. Downloading a GZIPed file is faster than downloading the uncompressed file.

To add GZIP to your website, edit the .htaccess file (found in the root directory of your website folder). It is a hidden file so you will need to tell your software to display hidden files. Use FTP software to log in to the root folder of your website. Add the following code to your .htaccess file.

   # Compress HTML, CSS, JavaScript, Text, XML, and fonts
   AddOutputFilterByType DEFLATE application/javascript
   AddOutputFilterByType DEFLATE application/rss+xml
   AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
   AddOutputFilterByType DEFLATE application/x-font
   AddOutputFilterByType DEFLATE application/x-font-opentype
   AddOutputFilterByType DEFLATE application/x-font-otf
   AddOutputFilterByType DEFLATE application/x-font-truetype
   AddOutputFilterByType DEFLATE application/x-font-ttf
   AddOutputFilterByType DEFLATE application/x-javascript
   AddOutputFilterByType DEFLATE application/xhtml+xml
   AddOutputFilterByType DEFLATE application/xml
   AddOutputFilterByType DEFLATE font/opentype
   AddOutputFilterByType DEFLATE font/otf
   AddOutputFilterByType DEFLATE font/ttf
   AddOutputFilterByType DEFLATE image/svg+xml
   AddOutputFilterByType DEFLATE image/x-icon
   AddOutputFilterByType DEFLATE text/css
   AddOutputFilterByType DEFLATE text/html
   AddOutputFilterByType DEFLATE text/javascript
   AddOutputFilterByType DEFLATE text/plain
   AddOutputFilterByType DEFLATE text/xml
 # Remove browser bugs (only needed for really old browsers)
   BrowserMatch ^Mozilla/4 gzip-only-text/html
   BrowserMatch ^Mozilla/4.0[678] no-gzip
   BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
   Header append Vary User-Agent
 

This code uses the mod_deflate module of your web hosting server. Most web hosting has this module enabled. If your server does not have the mod_deflate module turned on, ask your web host provider to turn it on.

Delete unnecessary plugins

The second WordPress tweak deals with the number of installed plugins. We have worked on WordPress websites with many extra plugins installed for no reason. Sometimes, a developer/website owner tries out different plugins and forgets to remove those not used. Log in to your WordPress dashboard and remove all deactivated plugins. Then, review the remaining plugins and ask yourself whether you really need the plugin. Oftentimes, we write a little piece of code that provides the same functionality provided by a plugin. Some plugins have extra code that makes calls to other websites. Each call tends to slow a website down. We have seen WordPress websites make over 100 calls for files!

Be wary of page builder plugins. Although these plugins provide a fast way to layout a page, some page builders add a ton of extra code to a web page. All this extra code slows down a website.

Update software

Surprisingly, keeping your WordPress website updated helps with website speed. For instance, the latest update to WordPress (version 5.2) includes many speed improvements. Updating your PHP version also speeds up a website. Updating PHP (to version 7.3 or better) also improves security. Keep your themes and plugins updated as well. We use automatic WordPress monitoring software that lets us know when updates are available for all our websites. Always test updates on a local server before updating a live website (especially when updating your PHP version).

Use a theme optimized for speed

Tweak WordPress by using a theme designed for speed. Most of the more popular themes try to provide everything for everyone. They include options to keep the greatest number of people happy. This smorgasbord of functionality tends to slow WordPress down. There is no need to load unneeded extra stuff. When a client stands firm on a certain theme, we add custom code to turn off unneeded features. Here are some of the faster themes we tested using GTMetrix (most of these themes are premium themes but they are worth the money).

  • Astra
  • Avada
  • Bridge
  • Genesis
  • The Gem
  • Jannah
  • Newspaper
  • Pofo
  • Scalia
  • X Theme

Get off shared hosting

Most shared web hosting platforms will tout that they offer unlimited bandwidth, storage space, and emails. What they do not tell you is that your website hosting server shares resources across many websites (sometimes several hundred websites). When one website receives an increase in visitors, it affects the speed of all websites on the same server. There are only so many resources to go around. Shared hosting slowdowns are especially noticeably during peak hours.

Host your website on a Virtual Private Server or a Private Server. Both options let you control how many websites you host on the server. There is some technical ability required to set up the server. Most hosting providers will help with the setup. Their control panels are self-explanatory and are easy to use. Buy the best web hosting server you can afford.

Optimize images

The last WordPress tweak concerns images. Improperly sized images account for most speed issues we meet with slow websites. Website owners take a picture with their camera or smart phone and they upload the image to their website. Other times, they take an image from one of the popular online image libraries and upload these to their website. The problem is that most of these images are huge in size (width and height) and are several megabytes in size. Most websites will look good with smaller images. For instance, a website with the maximum width set to 1440 pixels may only need images that are 1024 pixels wide.

Use image resizing software to reduce the size of images before uploading to your website. WordPress will automatically create smaller image sizes (large, medium, and thumbnail) based on default settings in the WordPress dashboard. Selecting the best image format will also reduce the file size of the image. PNG images are larger than JPG images. Google created a new format (WEBP) that is starting to catch on. When saving your image files, consider reducing the image quality. Most image editing software will let you reduce the quality of a saved image. Even reducing the quality to 90% or 80% will reduce the image file size without affecting image quality (especially for the web).

Use GZIP compression, delete unnecessary plugins, keep your software up to date, use a theme optimized for speed, get off shared hosting, and optimize your images before uploading them. Tweak WordPress to increase website speed and improve the experience for your visitors.

Need help tweaking WordPress?

Let’s chat.

Share This