13 Easy Ways to Speed Up Your WordPress Site
Why is fast page loading equivalent to fast growth for your site?
WordPress is a great platform. It is no secret that we are, without a doubt, operating in the most popular content management system in the world.
Because the system is so dynamic, there is also a downside – a slow page loading rate on sites that are rich in content, with many objects and plugins.
Without taking the appropriate and effective measures, you can bring your site to a state where it is very slow, and this will not only be a nuisance for returning visitors to your site, but will lower your search engine ranking score and will certainly cause you to lose visitors and customers.
First I would like to present the importance of the speed of your WordPress site, and then I want to go over all the good ways I can offer you to speed up your site.
Why site speed matters
You have surely heard this before, but when a person enters your site for the first time you have only a few seconds to capture their attention and persuade them to stay on the site.
If you have a website, you probably know the importance of proper branding, design, a pleasant user experience, and all of this in order to try to capture visitors and make them stay on your site,
But if your page loads slowly, you may lose visitors before you even get the chance to persuade them to stay.
Most studies show that you have a very short time to load your site before visitors leave it, especially when they are linked from another site they visited.
Think about it
Not only are you holding back your growth by losing these potential customers, especially at an early stage. losing potential customers like these, especially at an early stage.
On average you have a single-digit time window before you lose a visitor due to slow loading (usually 4-6 seconds), which means that if your site takes more than 10 seconds to load, most people will already have left; you lost them before you were even given the chance to convince them to stay.
In addition, Google now includes site speed in its ranking algorithm. This means that your site's speed affects the site's SEO (search engine optimization), so if your site is slow, you not only lose visitors because of their impatience, but also lose visitors because you received a lower ranking in search engines. So let's see how we can fix this.
How to speed up your WordPress site
It is worth noting that the order in which the content appears is not important; this is a collection of tools we can offer you, each of which is fairly self-contained. I promise that using even a few of these tools will speed up your site dramatically.
1. Choose a good hosting provider
At first glance, a cheap hosting server looks like a good deal, but it is worth paying attention to the details; this deal exacts a steep price:
You pay for this in slow site speed, repeated site outages when the load rises due to a large number of visitors, in the user experience your visitors get on your site, in your site's ranking in search engines, All these parameters are worth money.
If your WordPress site is important to you and you plan to use interesting features on it (for example, retrieving information from external sites, importing external scripts, importing external CSS files, using an API), you should take into account that these actions cause high resource and data-traffic consumption. You are setting yourself up for failure when you choose a hosting company with price as the only parameter by which you make your choice.
Invest in a good hosting provider. Based on our professional experience, it doesn't matter how much power your server has (traffic, capacity, speed) as much as whether your server is optimized for your needs and properly planned for your site, which in our case is a WordPress site.
A dedicated managed server for WordPress sites is the most suitable, and it will be reflected in performance. Period.
Of course, we recommend that you choose us as a quality hosting provider, thanks to the variety of technologies and tools we use for hosting.
2. Start with lightweight themes
You may be surprised, but the Twenty Seventeen / Twenty Eleven themes (WordPress default themes) are fast and easy-to-use themes. That is because they keep the "courage" of their simplicity: they don't try to impress with heavy scripts and effects, they stay simple, and at the same time They provide an important speed experience for the user.
3. Use an efficient caching plugin
WordPress plugins are without a doubt very useful. Our favorite caching plugin is WP Rocket, this is a plugin not free (40$ per year for a single site) but without a doubt – the best plugin for caching.
And not by chance, uPress users receive a license to use this plugin, precise settings of the plugin are very important (an unsuitable setting can have the opposite effect).
There are similar plugins on this subject, but we would not recommend using a different caching plugin (unless you are at an advanced level and understand the risks), because the WP Rocket plugin has all the features you need, and it can be used in a basic or advanced way (for beginners or advanced users).
4. Use a CDN service
All the big and beloved sites/blogs use a CDN. If you use online marketing through WordPress (as we are sure many of our readers do), you won't be surprised to hear that a large share of the big websites you know work under this method.
Basically, a CDN, or content delivery network, takes all the static files that exist under your site (CSS, JavaScript, images, etc.) and lets your visitors download them as fast as possible from the server closest to them.
There are a variety of CDN plugins and services offered for WordPress sites, but this is a complex topic; if you want to delve deeper into the subject you can read the article CDN – everything you wanted to know.
We offer for uPress customers Enabling and configuring a CDN at the push of a button from the management interface, by a CDN system installed on the server.
Using a CDN is very effective on international sites, but for use in Israel it may do the opposite (slowness), so you should use good judgment, or consult an experienced person.
5. Image optimization (automatic)
One of the main reasons for damaging the user experience and site speed is Heavy image weight.
Reducing image file sizes and properly optimizing images (in advance) before uploading them to the site significantly helps prevent problems of this kind, and also brings us closer to a score of 100 in Google's speed testing tool (not that it is the goal in life, but it will not hurt…)
A recommended plugin for performing this action is WP Smush Pro of the company WPMUDEV, this plugin is free for uPress customers – and the plugin can be installed under Sites >> WordPress >> Install recommended plugins.
6. Optimizing the home page so that it loads quickly
Optimizing the home page is not a simple task, but with a few simple actions you can make sure your home page loads quickly, and this is most likely the most important part of your site since people will arrive at this page most frequently.
The things that can be done to improve speed:
- Display excerpts instead of full posts.
- Reduce the number of posts per page (between 5 and 7 posts per page).
- Remove unnecessary sharing plugins from the home page (include them only within posts).
- remove inactive plugins and widgets.
- Keep it minimal; your visitors are interested in the content and not in 20 widgets on the home page.
All in all, a clear and focused home page design will benefit your site; not only does it look better, it will also load quickly.
7. Optimize your database
We certainly use the word optimization a lot in this article! There are various plugins in the field of database optimization; these plugins perform tidying and organizing operations on the database, and this operation shortens page loading times.
For example: organizing tables in the database, deleting empty \ unusable tables, deleting comments on very old posts, deleting unusable drafts, reducing similar tables, and more.. To perform these actions, we recommend using the plugin WP Rocket. In the hosting packages atuPress We perform automatic database optimization at the push of a button. This is a system built on the server, and a great deal of resources are invested in it for the benefit of users.
You can read the full article on How to install and configure the WP Rocket plugin for maximum performance.
8. Disable HOTLINKING of your content
Hotlinking This is a form of bandwidth "theft". It happens when other sites link directly to images on your site in their articles, which increases the load on your hosting plan.
This can have an impact as more and more people visit your posts or site (especially images) that become very popular. What you should do if you create custom images for your site on a regular basis is to write the following code in the file htaccess. of yours (if you use an Apache-based server):
#disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sparringmind.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]
9. Adding an expiration time to static files
Adding an expiration time is a way of specifying an expiration time for a file (CSS, image or scripts) so that visitors (browsers) won't have to download the static content anew every time (since in general it is supposed to be constant and not dynamic). This method can significantly shorten load time for returning users who come to your site.
To apply this option, copy and paste the following code into your htaccess. (if you are using an Apache-based server):
ExpiresActive On ExpiresByType image/gif A2592000 ExpiresByType image/png A2592000 ExpiresByType image/jpg A2592000 ExpiresByType image/jpeg A2592000 ADD CSS AND JS
The numbers above were set for a month (in seconds); you can change them as you wish.
Under the uPress admin panel: you need to enable the option under the Performance tab > Browser Leverage Caching.
10. Adding Lazy Load to images
Lazy Load is a process in which only the images that are on the screen are loaded (that is, only images visible in the visitor's browser window), and then, as the visitor scrolls down the page, the other images start to load, just before they are supposed to be displayed.
Not only will this speed up your page loading, it can also save bandwidth by loading less data for users who did not scroll all the way down the page.
To perform this action, there is a simple and excellent plugin; you can install the plugin BJ Lazy Load.
11. Controlling the number of revisions for stored posts
In general, as soon as you edit a post or page and save, WordPress automatically saves the previous version (a draft), in case you want to go back and see which changes you made.
These drafts are kept in the database indefinitely. Although this sounds like a great and useful system, over time this system creates a heavy load on the database.
There is an excellent plugin called Revision Control, this plugin puts the whole matter of versions in order, but an initial setup is required, which you will have to do yourself.
12. Clean up your code
Most of the WordPress system is based on queries to the database (mysql), where each such query is actually Request to the server, a request for a particular piece of data (for example: the blog name), receiving the data, and then the WordPress system displays it / any other action.
Each such request to the server takes load time from the browser (a fraction of a second), and when 120 requests to the server finally add up on a single page, the page becomes slow. For this reason we aim to tell the browser as much data as possible without asking the server, data that is not expected to change frequently.
For example: the site name, the site language, the content language, the domain address, the site description, and so on. The first file you will need to edit is the file header.php.
In addition, we can also tell the browser the following data:
- References to the relevant CSS files
- Current WordPress version
- Site name
- Site description
- Static RSS feed URL
- Shorten the length of the permalink line; there is no need to show the date and the category in the link
And there are many more examples of data you can tell the browser without sending a request to the server. It is important to note that basic cleanup work will take you about an hour and will significantly improve loading time.
The next file you will want to edit is footer.php, this file also contains several requests to the server that you can save yourself:
- Site name
- RSS feed URL
- Comments RSS feed address
It is also highly recommended to remove the WordPress support advertisement, "Powered by.." or "If you’d like to support WordPres", it is an unnecessary request to the server that can save you page load time. Sounds obvious? There are many sites that forgot to remove this line.
13. Check your programming habits
Let's say, for example, that you have a plugin that performs a site search, and after the search command there is a line of code embedded in the page that thanks the plugin for its service:
< ?php refer_thanks(); ?>
This line is a recipe for problems. Let's explain – say that one day you replace a search plugin \ deactivate the search plugin \ something happens to the search plugin that holds the function refer_thanks – meaning that this function will no longer exist either, but it is still embedded in the page.
So what is actually going on here? The page tries to load the function and can't find it, wastes time, in some cases doesn't continue, and the page gets stuck. To prevent such situations – there is a function PHP called function_exists, and we will use it like this:
< ?php if (function_exists(‘refer_thanks’)) { refer_thanks(); } ?>
Now, in fact, if the function does not exist, your site will skip this line and continue on to loading the page. This is a necessary action to perform for every line of code you add to your site that depends on a specific plugin.
In summary
WordPress is a great platform, but without taking appropriate and effective measures you can bring your site to a state where it is very slow, and this will not only be a nuisance for returning visitors to your site, but will also lower your search engine ranking and will certainly cause you to lose visitors and customers.
In this article we tried to explain the importance of your WordPress site's speed and presented the best ways you can use to speed up your site.
