How to make WordPress faster in 13 easy steps

How to make WordPress faster in 13 easy steps 



Make WordPress Faster

Make WordPress Faster

Is your WordPress lame?


Then you should act urgently, because you may lose a number of readers as a result!


Because under certain circumstances, your Google ranking and, according to a press release, the probability of your website being displayed in the Facebook newsfeed can suffer as a result.


Or are you just a speed freak (like me!) looking to shave a few more milliseconds off your load time?


Then I have 13 tips for you on how to make WordPress faster and drastically increase the performance of your website.


Table of contents

How can I test my loading time?

1. hosting

2. Enable gzip compression

3. Enable browser caching

4. Compress images

5. Install caching plugin

6. Disable unnecessary plugins

7. Use a lightweight WordPress theme

8. Clean up, combine and compress JS and CSS files

9. Reload images via Lazy Load

10. Switch to PHP 7 or 8!

11. Use HTTP/2

12. Disable or cache Gravatar

13. Disable emoji

How can I test my loading time?

To find out where there is room for improvement on your WordPress blog (and whether optimization measures are of any use at all), you should always test your loading time.


By far the best tool for this is PageSpeed Insights , which not only runs a complete Lighthouse test and shows the optimization potential, but also how you perform on the Core Web Vitals :


1. hosting

You can get a hosting package including a domain for a WordPress website from €1.00 per month. However, if you only look at the price when choosing the right hoster, you will end up paying more.


And not only because of lame customer support and poor availability, but also because of slow loading times.


This can be because the server software is outdated and does not yet offer the latest technologies, the server is not configured correctly, or there are too many customers sharing the existing server resources.


In general, I advise against mass hosters such as Strato, 1 & 1, DomainFactory, One.com or HostEurope.


Please get yourself a reasonable hosting package and don't mess around. Even if it costs a few euros more per month!


Hosters I can unconditionally recommend include:


webgo

WPspace

2. Enable gzip compression

Enabling gzip compression is one of the most important optimization measures that significantly increases the loading time of your website.


You achieve this by activating the modules mod_deflateor mod_gzip , which ensures that Javascript, HTML and CSS files are transmitted in compressed form. This reduces their file size by up to 70%!


To do this, all you have to do is log into your FTP server (you should have received the access data when you opened your hosting package).


Then open .htaccessyour website's file with a plain text editor and add the following code to the top of the file:


AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE text/javascript

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript

AddOutputFilterByType DEFLATE application/x-shockwave-flash

With web servers based on an older Apache version, the module may mod_deflatenot yet exist and you mod_gziphave to address the module instead.


To do this, simply insert the following instead of the code above:


mod_gzip_on Yes

mod_gzip_dechunk Yes

mod_gzip_item_include file .(html?|txt|css|js|php|pl)$

mod_gzip_item_include handler ^cgi-script$

mod_gzip_item_include mime ^text/.*

mod_gzip_item_include mime ^application/x-javascript.*

mod_gzip_item_exclude mime ^image/.*

mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

3. Enable browser caching

If browser caching is not activated, Chrome, Firefox and Co. do not save the files loaded on your website (such as images or CSS files) locally on the computer. This means that all files will be retrieved from your server again when the page is accessed again.


This can increase the loading time enormously. That's why it's essential to allow browsers to store files for longer periods of time.


Like compression with , you can activate browser caching mod_deflatevia the .htaccessfile.


To do this, simply add the following code, which will keep files of any kind in your visitors' browser cache for one year (31,536,000 seconds):


Expires Active On

ExpiresByType text/css A31536000

ExpiresByType text/x-component A31536000

ExpiresByType application/x-javascript A31536000

ExpiresByType application/javascript A31536000

ExpiresByType text/javascript A31536000

ExpiresByType text/x-js A31536000

ExpiresByType text/html A3600

ExpiresByType text/richtext A3600

ExpiresByType image/svg+xml A3600

Expires By Type text/plain A3600

ExpiresByType text/xsd A3600

ExpiresByType text/xsl A3600

ExpiresByType text/xml A3600

ExpiresByType video/asf A31536000

ExpiresByType video/avi A31536000

ExpiresByType image/bmp A31536000

ExpiresByType application/java A31536000

ExpiresByType video/divx A31536000

ExpiresByType application/msword A31536000

ExpiresByType application/vnd.ms-fontobject A31536000

ExpiresByType application/x-msdownload A31536000

ExpiresByType image/gif A31536000

ExpiresByType application/x-gzip A31536000

ExpiresByType image/x-icon A31536000

ExpiresByType image/jpeg A31536000

ExpiresByType application/json A31536000

ExpiresByType application/vnd.ms-access A31536000

ExpiresByType audio/midi A31536000

ExpiresByType video/quicktime A31536000

ExpiresByType audio/mpeg A31536000

ExpiresByType video/mp4 A31536000

ExpiresByType video/mpeg A31536000

ExpiresByType application/vnd.ms-project A31536000

ExpiresByType application/x-font-otf A31536000

ExpiresByType application/vnd.ms-opentype A31536000

ExpiresByType application/vnd.oasis.opendocument.database A31536000

ExpiresByType application/vnd.oasis.opendocument.chart A31536000

ExpiresByType application/vnd.oasis.opendocument.formula A31536000

ExpiresByType application/vnd.oasis.opendocument.graphics A31536000

ExpiresByType application/vnd.oasis.opendocument.presentation A31536000

ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000

ExpiresByType application/vnd.oasis.opendocument.text A31536000

ExpiresByType audio/ogg A31536000

ExpiresByType application/pdf A31536000

ExpiresByType image/png A31536000

ExpiresByType application/vnd.ms-powerpoint A31536000

ExpiresByType audio/x-realaudio A31536000

ExpiresByType image/svg+xml A31536000

ExpiresByType application/x-shockwave-flash A31536000

ExpiresByType application/x-tar A31536000

ExpiresByType image/tiff A31536000

ExpiresByType application/x-font-ttf A31536000

ExpiresByType application/vnd.ms-opentype A31536000

ExpiresByType audio/wav A31536000

ExpiresByType audio/wma A31536000

ExpiresByType application/vnd.ms-write A31536000

ExpiresByType application/font-woff A31536000

ExpiresByType application/vnd.ms-excel A31536000

ExpiresByType application/zip A31536000

4. Compress images

Most pictures taken with your own camera or created yourself with Photoshop or GIMP are larger than they need to be.


And that even if you have already saved them on the PC in a lower quality level.


Even if you z. For example, if you save a JPG image in Photoshop with quality level 8/12 and as progressive JPG (or with GIMP in quality level 85 and as progressive JPG), you can usually still make it 5-15% smaller without having to the quality suffers.


With PNG images, the savings are usually even greater and can be 50-80%, depending on the image.


To compress all images of your own WordPress installation, you can use programs on your own computer, such as B. Use ImageOptim (Mac) or the File Optimizer (Windows).


 However, it is easier to use the WordPress plugins EWWW Image Optimizer or Compress JPEG & PNG images for compression , which on the one hand allow mass compression of already uploaded images and on the other hand automatically compress all newly uploaded images.


5. Install caching plugin

A caching plugin is a must if you want to make WordPress faster. WordPress itself generates dynamic websites, which means that a database query is made for every element on your site (e.g. menus, widgets, posts, etc.) every time the page is accessed.


Dynamic loading may be useful for some websites whose content changes quickly or that want to display content in real time. For most blogs, online magazines or niche sites, however, it is rather a hindrance. Too many database queries worsen the loading time and the reader has no benefit from dynamic loading.


A caching plugin provides a remedy by generating static files from the dynamic content (so-called page caching), which reduces the number of database queries required (not to be confused with server requests, which do not change as a result of the caching plugin) to display a Website drastically reduced.


These static files are then regenerated by the plugin after a specified interval (e.g. one day) and/or when the content changes (new post, new comment, etc.).


As a caching plugin I recommend Cache Enabler:


Setup is easy:


Install, activate and done! You don't need to set anything else.


It's the fastest free caching plugin I know of. It beats some other plugins like W3 Total Cache by far. It also works with most themes, plugins and setups.


I also get good results with the WP Super Cache plugin. It is very suitable for beginners due to its easy installation (just switch on caching under Settings > WP Super Cache and you're done!) and its clear user interface.


6. Disable unnecessary plugins

Plugins often load unnecessarily many CSS or JS files or slow down WordPress with too many database queries. In addition, plugins always pose a security risk, especially those that are not regularly maintained.


That's why: The fewer plugins, the better!


Regularly go through the list of your plugins and ask yourself: Do I really need this? And if not, then away with it! If you need it but only use it sporadically, I recommend you only activate it when you use it and deactivate it again immediately afterwards.


The biggest loading time killers include:


Social media plugins (Twitter or Instagram feed, Facebook like box, share buttons without caching etc.)

Page builder (e.g. Visual Composer)

Broken Link Checker (disable after use)

Google Maps

Comment Plugins

contact forms

Forum plugins (Simple:Press, bbPress etc)

Woocommerce and other ecommerce plugins

7. Use a lightweight WordPress theme

Popular WordPress themes, such as B. Avada, X Theme, Enfold, The 7, Divi etc. offer many setting options, integrations, ready-made demos and/or a visual editor, which can make designing a website much easier.


But as great as this modular principle is, it also has disadvantages. Many features and design elements are loaded even if you don't use them. Unnecessarily many or unnecessarily large CSS and JavaScript files drag your loading time down.


All-in-one themes often come with the installation of many more plugins as well (e.g. sliders, contact forms, WooCommerce, bbPress, widgets). So please also check the plugins that come with the theme to see if you are actually using them. Even if the theme recommends installing a plugin, in most cases you can do without it.


For some themes, such as B. Avada, individual functions can also be switched off completely so that the corresponding CSS and JS files are no longer loaded.


At the end of the day, though, it's better to decide ahead of time on a theme that only has the features you really need, even if it takes a little longer to search for them.


8. Clean up, combine and compress JS and CSS files

WordPress installations are often slowed down by too many loaded Javascript and CSS files, especially if you have a bunch of plugins installed or are using a multi-purpose theme that offers many features.


On the one hand, you can remedy this by deactivating unnecessary plugins that burden the loading time and using a theme that is not so overloaded (see points 7 and 8).


Second, you can make WordPress faster by combining as many JS and CSS files as possible to reduce the number of server requests and compressing them to reduce the size of each request.


You can do this by hand, but it requires a lot of prior knowledge of WordPress programming. In addition, this also ensures that you have to dig deep into the theme, which can lead to complications.


It's easier to use the free plugin Autoptimize :


The configuration of the plugin is very simple: You go to Settings > Autoptimize and tick Optimize HTML code? , Optimize JavaScript code? and optimize CSS code?


For most themes and plugins, using Autoptimize shouldn't cause any problems.


If something doesn't display properly or doesn't work properly (be sure to check the mobile version too!), you'll need to see what's causing the complication.


You can usually find that out pretty quickly by going into the advanced settings and excluding certain CSS and Javascript files from optimization and seeing if that eliminates the complications.


If your server supports http/2 (see point 11), your website may load faster if you disable Autoptimize.

9. Reload images via Lazy Load

Compressing your images is an important step for better loading time.


However, if your blog or individual blog articles are very image-heavy, this may not be enough.


In this case, you should use so-called lazy loading, which ensures that images are only loaded when a user scrolls to the appropriate place.


You can install an extra plugin for this, e.g. B. a3 Lazy Load , which in my experience works with many themes and setups.


However, it is easier to use Autoptimize for this (if you already have it installed).


You can activate lazy loading by ticking the Lazy loading of images option in the Settings under the Images tab.


After turning on lazy loading, please check if everything is working properly! Sometimes it can happen that images above the fold are only displayed after scrolling, which is not the point. In addition, lazy loading may cause tracking pixels such as e.g. B. the Facebook pixel or VG word counters no longer work properly. To prevent this, you can specify them in the Exclude from delay field .

10. Switch to PHP 7 or 8!

By upgrading your server from PHP 5.x to PHP 7.4 or PHP 8.x, you can speed up WordPress significantly. Sometimes this makes your website twice as fast !


It is not for nothing that PHP 7 or higher is also recommended in the official hosting requirements .


You can usually change the PHP version in the settings area of your server. If not, ask your hoster to do it for you.


Please test whether everything still works as it should after switching to PHP 8. Most plugins and themes should now be compatible with the new PHP version, but there may still be problems.

11. Use HTTP/2

HTTP/2, the successor to HTTP/1.1, offers significant speed advantages over the older version of the Hypertext Transfer Protocol , which was the transmission standard on the WWW for over 16 years.


In case you are interested in how the extra speed comes about:


With HTTP/1.1, all requests are still processed one after the other, with HTTP/2 several requests can now be processed in parallel (which means it is no longer necessary, for example, to combine image files in CSS sprites or all JS and CSS files) .


In addition, headers are transmitted in compressed form and thanks to server push, the server can prioritize the requests that are most important to the client (i.e. the browser user).


You can use this tool from KeyCDN to test whether your server supports HTTP/2.


If that's not the case, ask your host to implement it, or use it as an opportunity to switch hosts right away.


If you have a vServer or dedicated server with root access, you can sometimes even set it up yourself.


Please note that HTTP/2 is only supported by most browsers in combination with HTTPS, making the switch to HTTPS not only a security measure but also a load time measure.

12. Disable or cache Gravatar

If a blog article has a lot of comments, it may extremely slow down the article's loading time because each commenter's gravatar image is loaded.


The FV Gravatar Cache plugin can help , with the help of which Gravatar images are cached on your own server, which in my experience improves the loading time a bit.


Alternatively, you can switch off your own avatar images completely and replace them with a standard image.


13. Disable emoji

There are some functions in the WordPress core that negatively affect the loading time and are not absolutely necessary.


For example, a small script is loaded that ensures emoji support in older browsers.


You can switch this off relatively safely and thus save a server request (the JavaScript file wp-emoji-release.min.js with a size of 10.5 KB).


It won't make your website exorbitantly faster, but it never hurts to save a few milliseconds, right?


You can also turn off the emoji script in the Autoptimize settings by ticking Remove emojis in the Extras tab :


If you don't use Autoptimize, you can also use the Disable Emojis plugin to do that .

Powered by Blogger.