Reduce the number of HTTP requests and speed up your WordPress site

Although all it takes to load a website is a click of the button for you, there’s much more for computers to handle. That one click and one second that will take until a page is displayed in front of you may hide dozens if not hundreds of HTTP requests to the server. Obviously, the more information goes back and forth, the longer you will have to wait for a site to load.

One of the easiest things you can do to speed up your site is to have a good hosting company. But when you decide to go even deeper to speed up your WordPress website, you should take care of HTTP requests.

For starters, you should test your website to see how many requests does it take to load a particular page. There are different ways of testing that. Instead of showing you all the possibilities, it will suffice to enter an URL in the HTTP Requests Checker. You will get the results immediately, and hopefully, you won’t have more than 30-ish requests. If you do, it’s time to reduce the number of HTTP requests and speed up your WordPress site.

HTTP Requests Checker

Delete plugins that you don’t use

Let’s start with the basics. By now, people are aware of the fact that too many plugins can slow their sites. Still, those same individuals tend to install plugins for stuff they don’t even need. Cmon, admit it – how many times have you installed three or four plugins that do the same thing just to check them out and then forgot to uninstall those you don’t need anymore? How many times you didn’t want to deal with the code and customize things on your own, but used a simple plugin instead?

Sure, having plugins will speed up your work, but at the same time, they will slow down your site. So, please go to the list of the WordPress plugins on your site, take a few minutes and deactivate and uninstall those that you don’t need. Take some time and try to find an alternative to the plugin – more often than not, you can replace a simple plugin with a function that you just need to copy and paste.

Don’t use Gravatars

If you’re using WordPress’ default commenting system, you are using Gravatars as well. Now, if you get a few comments per month, this doesn’t have to concern you much. But if your visitors like to leave quick notes below your articles, you should consider removing Gravatars from the picture.

Once we tell you that each Gravatar image adds another HTTP request to the server, imagine what happens when you have more than, let’s say, one hundred comments on a single page? Guess what happens when there are more than one hundred additional requests that don’t have to be there – yes, your site gets slower.

HTTP requests Checker

If you don’t need those little images next to each comment, just navigate to Settings -> Discussion -> Avatars and uncheck the option to show avatars in comments. It’s easy as that. In case you just have to have avatars, you should consider installing a 3rd party commenting system for WordPress which will handle things differently. For example, Disqus is a popular choice that does the job of showing avatars much faster.

Remove comments if you’re not using them

As you may guess, using comments requires additional files. If you’re using the default commenting system, you don’t have to do a thing – it’s something that you have the benefit of and that extra request is justified. But in case that you don’t use comments on your site, or you use a different commenting system, you should remove the comments-reply script. To do that, you need to copy the following function in the functions.php file:

function comments_clean_header_hook(){
 wp_deregister_script( 'comment-reply' );
 }
add_action('init','comments_clean_header_hook');

Minify CSS and JS files

Minification will not only remove the unnecessary characters from CSS and JS files, but it can also combine several files into one. So, instead of loading several smaller ones, you can load just one minified file.

We talked about minification just a few days ago, so learn how to minify CSS and JS files in WordPress.

Remove emojis

Yes, emojis are cute. Yes, everyone uses them on their computers, smartphones, and tablets. Although WordPress introduced them in the version 4.2. that doesn’t mean you have to load that one additional JS file on your site just to have the smiley faces. The speed of your site should be more important than having emojis (unless you just can’t live without them).

Since we have already talked about this, we’re not going into details about removing emojis. Learn how to properly remove emojis from WordPress admin and site.

Use CSS Sprites in WordPress

As you can see from testing a page, each image requires an HTTP request. That doesn’t mean that you should remove the pictures, but you should take care of them. When it comes to the speed of your site, learn how to optimize images for WordPress. But when it comes to the requests, you can reduce the number of those HTTP requests by creating CSS Sprites.

If you go to Spriteme site, you’ll be able to select all images from a page that you use and combine them into one file. After changing links to the images, you’ll add up to the picture size, but at the same time, you will reduce the number of requests. This might sound contradictory, but you can actually speed things up – a server will work better with one large file than having to respond to dozens of requests.

Limit the number of social media buttons

Social media has become a standard part of every website. Whether you have small personal or business site, or you’re running a portal with dozens of writers, you will have to connect social media to the site. That’s ok, and you should do that.

But when it comes to showing social buttons, less is more. Although you may have opened accounts on a dozen of networks, display buttons only for those that you nurture the most. Each button will load its own image and additional files which may slow down your site.

Unload scripts and styles that you don’t use

Unload scripts and styles and speed up your site

An average WordPress user doesn’t have a clue what going on in the background. Who’s got the time to think about scripts and styles on a site. We don’t blame you for that, but now that we got your attention, take some time to check your site for scripts and styles that you don’t need.

You don’t have to be an expert. We already showed you a neat little plugin that will show you all scripts and styles that load on each of your pages. By using WP Asset CleanUp, you can easily recognize the files you no longer need, and you can quickly unload them. If you have more experience with WordPress, the plugin will help you isolate the data, and you can later manually delete the files. If not, leave the plugin and let it handle scripts and styles for you.

Disable embeds

To improve user experience, WordPress developers introduced a new JS file that allows you to embed videos from different services like Youtube is just by copying an URL. You can embed images and tweets the same way just by pasting the link in the Visual Editor.

While this feature is an amazing one, many people just don’t use it. If you’re trying to speed up your site, it is more important to remove one request than having a preview of the video. You know which video you’re embedding, so there’s no real need for having that preview, right?

If you’re not good with code, and you just have to install a plugin, there a simple plugin that will remove embeds from your site. If you can handle a few lines of code that you just need to copy, use the following function and put it in your functions.php file:

function speed_stop_loading_wp_embed() {
if (!is_admin()) {
wp_deregister_script('wp-embed');
}
}
add_action('init', 'speed_stop_loading_wp_embed');

Use Google Maps Widget when showing maps

Did you know that a simple Google Map that you embed can take up to 70 requests to your server!? You can do all the things previously mentioned and remove a few requests, but loading that one map can put a tremendous stress on your server.

Instead, you can reduce those seventy requests to just one by using Google Maps Widget plugin. If you’re interested in more details, check the review we wrote months ago.


Take your time, and check your WordPress site for those unwanted HTTP requests. Even if you reduce the number just for a few pages, or if you find just file that you don’t have to load, it will be a success. Don’t worry; even if your users don’t feel the speed improvement, search engines will.

START YOUR OWN BLOG

This guide is an introduction to mastering the art of blogging. It provides easy to follow steps to start, maintain, and grow your blog.

Read the guide

One thought on “Reduce the number of HTTP requests and speed up your WordPress site

Leave a Reply

Your email address will not be published. Required fields are marked *