Is your WordPress website loading too slowly and you don't know why? This is not only frustrating but can, in the worst-case scenario, increase the bounce rate of your visitors. In this article, we will show you possible causes for the problem and give you some tips for improving performance.
1. Measuring Load Time
First, we recommend you measure the effective load time of your website. Based on the results, you can later see whether the individual adjustments have the desired effect.
To measure the load time, you can use the Pingdom tool.
Here’s how to proceed:
- Visit the Pingdom website .
- Enter your domain in the URL field.
- Select your region.
- Start the test.
→ If slow elements are detected, they will be listed under «File requests». - Look for long load times of elements like plugins, images, scripts, and note them down.
2. Optimizations
Thanks to the analysis, you now have an overview of the elements that exhibit long load times and slow down your website.
2.1 Deactivate Plugins
Plugins have a significant impact on the performance of your website. Therefore, we recommend using only the plugins you really need. Unnecessary plugins include, for example, those that allow you to add Google Analytics code to your website.
This can be done quickly, without much effort and without a plugin, using the Google Analytics guide.
To analyze the impact of plugins on your website, deactivate all plugins and reactivate each one individually. After reactivating each plugin, measure your page's speed to find out which plugin slows down your website. Alternatively, you can also use the plugin «Query Monitor» for this purpose.
2.2 GZIP Compression and mod_deflate
GZIP is a compression program that compresses files from your web server (e.g., text, CSS, images) before transmitting them to the browser. This allows the files to be transmitted faster. You can test whether your website is already compressed here.
With the «mod_deflate» module, you can enable GZIP compression and save between 40 % and 70 % of the transfer volume. You can choose which rules to apply for compression.
To enable the module, you need to add code to the .htaccess file of the website. Here’s an example where text files (TXT, HTML, CSS, etc.) are compressed:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
2.3 Other Optimizations
The database that WordPress uses accumulates some unnecessary data over time, such as:
- Deleted pages
- Spam comments
- Revisions
- Deleted plugins
To optimize the database, it's best to clean it up with a plugin like Autoptimize or WP-Optimize. After installing the plugin, you can optimize CSS, JavaScript, and HTML code, among other things.
There is also the option to load images with «Lazy Loading». This means that data objects are only loaded when they are needed.
3. Caching
Caching is one of the most important aspects to significantly increase the performance of the website. Caching ensures that WordPress does not have to rebuild each page in the browser but can rely on a finished version from the created cache. Therefore, it is important to utilize caching at both server and browser levels.
You can configure the cache of your WordPress website most easily with plugins like W3 Total Cache.
These plugins offer, among other things, the following functions:
- Delayed loading of JavaScript
- Minification of CSS and JavaScript
- Database optimization
- Lazy Loading
- Browser Caching
- Page Caching
4. WordPress with Nginx
Emubox offers the ability to use Nginx with Reverse Proxy and Apache.
One advantage of Nginx with Reverse Proxy is that you can take advantage of the speed of Nginx in combination with Apache. The Nginx web server handles all static requests to the website, while Apache processes the dynamic requests. This results in the Apache web server being less loaded, leading to a significant performance increase.
In our tests, the option to use Nginx with Reverse Proxy and Apache proved to be effective. Unlike the same installation on a shared web hosting, the performance of the website could be increased by 50 %. The two systems complement each other excellently. Therefore, you should definitely also work with a separate cache plugin at the WordPress level.
It is important that Nginx only caches if the HTTP headers are correctly set. For more information on this, you can find in this article.
5. Cron Jobs
Another way to improve performance is to replace WP-Cron with real cron jobs. WP-Cron is a cron job from WordPress that performs certain recurring tasks (e.g., checking for updates). The disadvantage of WP-Cron is that the cron jobs are executed every time the website is accessed. The server must then process the website request and the cron jobs simultaneously, which can lead to overloads on the web hosting.
To disable WP-Cron and replace it with a real cron job, do the following:
- Log in to the Emubox Control Panel .
- Under «Websites & Domains», select your domain.
- In the «Dashboard», click on «Files» to open the File Explorer.
- In the directory of your WordPress website (normally: httpsdocs), look for the configuration file «wp-config.php».
- Click on the file «wp-config.php» to edit it and add the statement define (‘DISABLE_WP_CRON’, ‘true’); in the file before the line /* That’s all, stop editing! Happy publishing. */.
- Click on «Save».
→ WP-Cron has been disabled. Now you can set up your own cron job. - Navigate in the menu to «Websites & Domains» > «Dashboard» > «Scheduled Tasks».
- Click on «Add Task».
- Insert the following code as a command. Replace https://ihre-eigene-domain.ch with your website.
- Set an interval for execution. Further information can be found in this article.
- Click on «OK».
→ The cron job will execute the file wp-config.php at the scheduled interval.
6. Cloud Server
If you want to further optimize the performance of your website, consider switching from shared web hosting to a cloud server. With cloud servers, you benefit from more resources (CPU/RAM) and other caching options such as Redis in combination with cache plugins. You can find all information about cloud servers on the product page on our website.