WordPress Optimize

Optimize your WordPress Website with the 10 Most Important Levers

The web is teeming with tips and tricks on how to optimize your WordPress performance. Unfortunately, explanations and evaluations of the relevance of the various screws quickly fall under the table. We show you the important starting points and adjusting screws - in a sensible order and with context. This way you can achieve success especially fast.

In the meantime we have hosted a lot of WordPress projects. In the process, a whole lot of data has accumulated. And we are asked again and again, how the loading time of a WordPress website can be further reduced. So we have systematically processed our findings from the past years. The result: 10 measures with which you can quickly and easily optimize your WordPress pagespeed.

One thing in particular is important: some are quickly put off by optimization suggestions from tools like Google PageSpeed Insights. Let me tell you: You won't gain the most loading time with complicated optimization measures, but with methods that are easy to implement.

WordPress optimization suggestions by Google
Few people can actually do anything with this message. It's far more important to focus on the simple optimization steps first, and then tackle the more complicated ones as a second step.

Of course, load time optimization is not an end in itself. In addition to a better user experience, a shorter load time also brings advantages for your visibility on Google. So I'll also briefly outline what the individual optimization steps are actually about in order to create the appropriate context.

In theory, you can work your way down from the top to the bottom and improve the loading time of your website step by step. By the way, the first seven points also refer to the typical improvement suggestions from Google PageSpeed Insights, which we discuss in more detail in this article, for example.

#1 Caching - the most important performance factor for fast loading times

Caching means your website doesn't have to first be requested from the webserver by the browser and then put together bit by bit. Instead, your website is loaded, i.e. completely rendered, from temporary storage.

The benefit of caching is obvious: WordPress doesn't have to build up your website every time someone wants to visit the page. As WordPress is based on PHP, which is quite slow, a cache is essential. Among other things, a cache prevents PHP from needing to be read.

In principle, there are two ways to implement a cache:

  • Via caching plugins: The majority of users use a caching plugin plugin, like W3 Total Cache or WP Super Cache. These are sometimes easier, sometimes a bit more complicated to set up. In any case, a certain amount of manual work is required with a plugin.
  • Via your hosting providers: Some hosts, including Raidboxes, offer server-side caching. This means you can almost always do without caching plugins because your hosting provider has already done the configuration of the cache for you.

If you've set up performant caching, you've already made the most important step towards WordPress optimization. For more details, check out our article on caching basics.

#2 Spring clean your WordPress

In our experience, one of the most common causes for long loading times is an overloaded WordPress installation. And because this lever isn't mentioned by Google PageSpeed Insights, it comes directly in second place in my top 10.

In most cases, a cluttered WordPress installation means there are too many plugins installed. Basically, the fewer plugins, the faster the website. Of course plugins are important and you can't do without them, but you should always check which plugins you really need.

Important: Make sure you delete extra plugins completely and don't just deactivate them.

Optimize WordPress: Your plugin overview will show you exactly how many plugins you have installed, activated and still need to update.
Your plugin overview shows you exactly how many plugins are currently disabled. In principle, there should always be a zero at "Inactive". If not, ask yourself whether you really need the deactivated plugin.

The same applies to deleting themes: you don't need more than one.

Every plugin and theme adds PHP code to your website, even if you disable them. This makes your website more bulky and therefore slower (and more vulnerable to attacks). PHP is a very slow scripting language so the less there is of it, the better.

Often plugins and themes that are no longer needed are leftovers from functional and design tests. It's good idea to clean up your WordPress websites regularly and to test new functions and designs in a test environment and not on the website itself. This way, you can avoid accumulating too many plugin remnants in the first place.

#3 Images: the underestimated speed breakers

One of the most effective and easiest ways to reduce loading time is to reduce the size of images. Here you can save large amounts of data. Lossless image compression reduces the file size of your images without any visible loss of quality. This means that your site hardly changes at all, and at the same time you can significantly reduce the size of your images by optimizing them.

Images often make up the largest portion of a website's data volume. Reducing the size of your images should therefore be one of the first optimization steps. You can either optimize your images manually, or you can use a compression tool plugin.

Using plugins is certainly the more comfortable solution. Plugins not only allow you to compress new images and their thumbnails, they also automatically take care of all existing images on your website. However, this service is often subject to a fee.

#4 CSS and JavaScript: sounds complicated but optimization is easy

The second largest amount of data on your website is usually JavaScript and CSS files. And this is what many people shy away from. But even without any knowledge of code, you can easily understand what CSS and JavaScript optimization is all about. Basically, there are three things to do first:

  • Summarize: CSS and JavaScript are hidden in many small individual files. Normally, each of these files must be requested individually from the web server by the browser. This generates HTTP requests that tend to increase the loading time of your website. However, when scripts are combined, the number of files to be loaded is reduced, and thus the number of requests. For example, 53 individual requests become only a dozen or so. Of course, this can also be done by plugins.
  • Reduce: CSS and JavaScript files are lines of code that enable certain features and designs on your website. This code is written by humans. But it's read by machines. Why is this relevant? Much of what a human needs to understand code correctly, a computer does not. So spaces, comments and the like are not needed for your website to be built correctly. This is where plugins like Autoptimize come in. They convert CSS and JavaScript from human readable to machine readable code. This makes the individual data packets smaller and their transmission faster.
  • Compress: After summarizing and reducing, the final step is then compressing the data packets that are sent from the web server to the browser. This means that the server minimizes the file size of each request and the browser unpacks and calculates them. This is faster than sending uncompressed data packets. You can set up such a GZIP compression for example via caching plugins, via manual settings in the .htaccess or your host has already activated a compression on the server side.

So even without knowledge of the scripts, it's easy to understand what the individual measures bring. For all three steps there are plugins that allow even beginners to optimize CSS and JavaScript. In our article on CSS and JavaScript optimization, we go into more detail and show you various plugins.

There we go!

These were the four areas where you can save a lot of loading time. With relatively little effort you can already optimize your performance - through caching, image optimization, optimizing CSS & JavaScript and cleaning up WordPress you can already achieve significant improvements.

#5 Hosting has a great impact on loading times

The first four optimization fields promise a particularly large reduction in load time, but can come to nothing if your hosting slows you down. This is not so much about the hardware requirements for WordPress, but rather about certain technologies that show you that a host even allows you to optimize WordPress accordingly.

As a rule of thumb, you can remember that high-performance WordPress hosting should give you at least the following:

  • SSD hard disk
  • PHP memory limit of at least 64MB, better 128MB
  • Data center in the geographical vicinity of your target group
  • Current PHP version
  • HTTP/2 and free SSL certificate

Then there's the difference between shared hosting and separate (virtual) servers.

With shared hosting, you share the server and its processing power with other websites. Usually a few dozen to a few hundred. With your own server, you don't have to share processing power with anyone. The advantage of not sharing resources is performance security.

Although your own server doesn't automatically mean more performance, experience shows that cheap hosting plans in particular, i.e. those only costing a few euros per month, can't compete with virtual servers in terms of performance.

"*" indicates required fields

I would like to subscribe to the newsletter to be informed about new blog articles, ebooks, features and news about WordPress. I can withdraw my consent at any time. Please note our Privacy Policy.
This field is for validation and should not be changed.

The finer points - less clout and more effort

All of the performance-related areas I've mentioned so far can be optimized by almost anyone. Either through plugins, simple trial and error, or by purchasing the appropriate products. It gets more complicated once you've already optimized these areas. Because then you have to go deeper into the website structure. And individual optimizations no longer have the same impact.

#6 Render blocking – wrong loading order

A loading order that blocks rendering is one of the things that performance optimization tools such as Google PageSpeed Insights repeatedly criticize.

An example will illustrate the problem: A slider consists of images and the animation command that rotates those images. If the JavaScript command is loaded first and the images last, your page will already have the slider function, but not the images to display. Therefore, the page will take longer to load. The correct loading order can prevent this from happening.

Although there are plugins for loading order optimization, our experience shows that they are not always able to fully optimize your website. In fact, the best results in this case are usually achieved by a web designer who knows the website and its features well.

#7 Above the fold – optimizing the visible area of the page

In addition to the total loading time of your website, the perceived loading time is also crucial. This is the time that is visually perceived as loading time. This perceived load time can be reduced with a few tricks. For example, you can give the impression that the site is already fully built, even though processes are still going on in the background.

Particularly important to optimizing this area, known as above the fold, is optimizing the loading order. This means prioritizing content and features that you want your visitors to see on the first screen view without scrolling.

Optimize WordPress: Above the Fold image from raidboxes.com
The upper area is displayed to the visitor of raidboxes.de without scrolling. This is the so-called Above the Fold. For all further information the visitor has to interact with the site and scroll.

You can achieve this, for example, by optimizing the loading sequence. But there are also plugins that make your site load more efficiently. And only the visible area. a3 Lazy Load is an example of such plugins. So you still get all content displayed, but the page load time can benefit from it, especially if it is an image-heavy site .

#8 Cleaning up your database

Besides images and scripts, your database can also get too big. There are practical tools that keep your database nice and lean, among others the plugin WP-Optimize.

#9 Pingbacks and trackbacks

By default, WordPress interacts with other websites that allow pingbacks and trackbacks. Every time your site or one of your blog posts is mentioned on one of these sites, your site is automatically notified – putting additional load on the database.

If you don't need this feature (in my opinion the added value is negligible anyway), you should disable pingbacks and trackbacks. Again, the plugin WP-Optimize helps here. For the sake of completeness, I should mention that this is more of a theoretical problem. So far, we have not seen it cause any serious performance issues.

#10 Prevent hotlinking

Hotlinking means that someone links directly to an image on your server - effectively "stealing" your bandwidth. On an Apache web server, you can prevent hotlinking by adding the following code to your .htaccess file:

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?yourwebsite.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?google.de [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?google.com [NC]

RewriteRule .(jpg|jpeg|png|gif)$ – [NC,F,L]

To prevent hotlinking on an NGINX server, add these lines of code to your NGINX config file:

location ~ .(gif|png|jpeg|jpg|svg|webp)$ {
     valid_referers none blocked server_names
	 *.example.com example.* www.example.org/galleries/ ~\.google\.;
     if ($invalid_referer) {
        return 403;
    }
}

Breakdown of the code:
location ~ .(gif|png|jpeg|jpg|svg|webp)$ {
specifies the file extensions you want to protect from hotlinking, for example if you still want to protect PDF files, the code line would look like this:
location ~ .(gif|png|jpeg|jpg|svg|webp|pdf)$

{valid_referers none blocked server_names
*.yourwebsite.com ~.google. ~.bing. ~.yahoo.;
These lines are a bit extensive, but it will help you better understand what you can do with this rule. These lines specify which domains are allowed to hotlink your files anyway. In this example yourwebsite.com with all subdomains, as well as Google, Bing and Yahoo.

if ($invalid_referer) {
return 403;
}
Now when a request comes in and the request resource is NOT in your whitelist above, the server returns a 403 error (Forbidden).

Other methods to prevent hotlinking

There are many security plugins in the official WordPress plugin directory you can use to prevent hotlinking, e.g. All In One WP Security & Firewall. At Raidboxes you can also prevent hotlinking via the CORS headers in your Box settings. If you have any questions about the header config of your Box, feel free to contact us in support.

"And what about CDN?"

One of the most frequently asked questions is about a Content Delivery Network (CDN). For example: "Does a CDN make my website faster for visitors in Germany?", "Why do I actually need a CDN?", "Would you recommend me to use a CDN for my blog or store?". In most cases, however, the answer has been: No.

To make a long story short: A CDN makes the most sense if your users are geographically dispersed. For example, if you have customers in Central Europe, South America and Australia. If your core audience is limited to one country, you don't need a CDN for WordPress optimization.

By the way, the WordPress developer Ernesto Ruge has written a very nice article about this problem, which I highly recommend reading.

Conclusion: Don't be afraid of complicated-looking optimization steps

Often there's a fear of dealing with areas where it would be particularly easy to save load time, and they're neglected. Others, however, such as CDN, come up again and again in consultations, even though they usually have no effect at all on the loading time of the website.

Therefore, I can only advise that you should first focus on the "low hanging fruits" of WordPress performance optimization. Because with relatively little effort you can already make great progress in reducing your load time. And that even if you are a layman.

So don't be discouraged by advice and suggestions from tools like PageSpeed Insights.

At its core, performance optimization is covered by only a few areas:

  • Reduce the size of your website
  • Reduce the number of HTTP requests
  • Compress the individual data packets
  • Optimize the perceived loading time

If you've understood this, then you can also sensibly pull the 10 most important levers for WordPress optimization. And for more complex optimization steps, there are also experts out there to help you get your website into shape.

The loading time will thank you!

Did you like the article?

With your rating you help us to improve our content even further.

Write a comment

Your e-mail address will not be published. Required fields are marked with *