How to Boost Your Website’s Performance: Part 2 – Content-Related Considerations

When it comes to your website’s performance, there are many factors that work together to increase or decrease your site’s load times. Measuring and monitoring your performance metrics is fairly simple, but implementing improvements can be trickier.

Fortunately, page speed tools such as GTMetrix can provide useful insights into what’s slowing your site down. Whether you need to look into your server, optimize your content, or crack down on your site’s code, you’ll find solid recommendations in your performance test results.

In part two of this series on performance optimization, we’ll look specifically at content-related changes you can make to boost your site’s speed. Let’s get started!

Understanding factors that influence your site’s performance

When it comes to site performance, there are a whole host of possible reasons for slow loading times. They could be attributed to something as large-scale as your server, as detailed as your site’s code, or a variety of factors in between.

As far as your site’s content goes, performance is tied largely to the number of requests a user’s browser has to make in order to display your site. The fewer requests needed, the faster the browser can show your content users.

This means you’ll need to optimize your content for efficient delivery from server to user. There are a variety of ways to improve this aspect of your site, several of which we’ll cover later in this post.

However, remember that the only way to fully maximize your site’s performance is to address all the areas of influence. Make sure to read part one of this series to learn more about how to handle server-related recommendations from your GTMetrix performance test results.

How to boost your website’s performance 2: content-related considerations

Optimizing your content for performance can admittedly get tedious. However, taking the time to address the factors below will help speed your site up for an improved User Experience (UX) and lower bounce rate. Your efforts will almost certainly pay off.

1. Remove query strings from static resources to enable caching

Before we can get into how to remove query strings from static resources, we need to break down the parts involved in this process. First of all, a query string is part of a URL, and it can be useful for a few different reasons.

In short, the purpose of a query string is to produce a new URL every time a page is loaded, while still showing the same content every time. They’re used to circumvent caching, track analytics, reload ads, and a variety of other tasks.

You can usually identify a query string because it will include a question mark (?) and/or an ampersand (&). For example, in the URL below, the part including and following the question mark is a query string:

An example of a query string.

You can see that, if the query string is removed and the page is reloaded, the exact same content is displayed:

A page reloaded after the query string has been removed from the URL.

A static resource refers to a part of your website that doesn’t change. For example, your About page probably always shows the same content, and is therefore made up static resources. On the other hand, a home page with a header image that changes each time the page is loaded is considered dynamic.

So, because they can prevent caching, query strings can slow down the load times of static pages by forcing browsers to reload the same page every time. By removing query strings from static resources, you ensure caching can occur, and thereby increase the page load speed.

Removing query strings using code

There are various methods to remove query strings from static resources. One is by adding code to your functions.php file. To do so, you’ll need to access your server using File Transfer Protocol (FTP) and a client such as FileZilla. It’s recommended to back up your site first.

Once you’ve located the functions.php file in your theme’s folder, right-click it and select the View/Edit option. Next, add the following code to the end of the file:

//* TN – Remove Query String from Static Resources
function remove_css_js_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_css_js_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_css_js_ver', 10, 2 );

Once you’ve done so, save your changes and make sure the file is uploaded to your server. Finally, check your front end for query strings.

Using a plugin to remove query strings

The other (simpler) option is to use a plugin, and W3 Total Cache is one of the most popular and highly rated:

The W3 Total Cache plugin.

Simply navigate to the plugin’s browser cache settings within WordPress, and make sure the Prevent caching of objects after settings change option is unchecked:

The setting to remove query strings using W3 Total Cache.

Save your changes, and you should begin to see a decrease in loading times where query strings previously existed.

2. Reduce your site’s HTTP requests to increase efficiency

Hypertext Transfer Protocol (HTTP) requests are simply the method by which your server delivers information to your user’s browser. Every time your site is loaded, a HTTP request is made to access the files that are your site’s content.

You generally want as few requests as possible for speedy page loading times. For an analogy, imagine you’re at a restaurant. You firstly ask your waiter for your drink, then for ice to put in your drink.

Next, you order your main course, place a separate order for each of your sides, condiments, silverware, napkin, and dessert. Of course, these requests will take a long time, and probably leave you feeling pretty frustrated.

Your site’s users will feel the same way. There are a few ways to reduce the number of requests browsers have to make to your server, some of which – such as minifying and combining CSS and JavaScript – we will cover in part three of this series.

Optimizing images

Apart from optimizing your code, you can also work on optimizing your images to reduce HTTP requests. Each requires its own request, so removing any extraneous images you don’t really need will help improve your site’s speed.

However, images can (of course) add value to your site. For the ones you want to keep on your site, it’s best to optimize and compress them to remove unnecessary file information and make them easier to retrieve. A plugin such as ShortPixel can automate this process for you:

The ShortPixel plugin.

You can also look into Lazy Loading, which uses JavaScript to load images when they come into users’ view as they scroll down the page. A plugin such as Lazy Load by WP Rocket can help here:

The Lazy Loading plugin by WP Rocket.

Images and other media files are some of the largest your site holds, so optimizing them has a chance to greatly improve your website’s performance.

Reducing external scripts

Third-party site integrations can provide useful and interesting features for your users. However, they can also add to the number of HTTP requests needed to load your content, thus dragging your site’s speed down.

Features such as live social media feeds and payment gateways can impact your site significantly with extra requests. It’s possible these features are crucial to your site’s ability to function, in which case removing them may not be worth it.

However, if your site is stuffed full of extra features that aren’t serving much of a purpose, it’s better to remove them. Focus on the elements your users actually seem to engage with and benefit from, and let the rest go.

Eliminate broken links

Sometimes website owners choose to move or destroy content on their websites. When this happens it results in links to those page becoming ‘broken’. When a user clicks on a broken link on your site, the browser has to make a request only to deliver an error to the user.

To avoid these wasteful requests, it’s wise to periodically check your site for broken links. A plugin such as Broken Link Checker can streamline the process:

Broken Link Checker

Although, we recommend using Link Monitor as it is an advanced version of Broken Link Checker that is also light on your website resources.

Once you’ve located your site’s broken links, you can either remove them entirely or replace them with working ones. It’s a simple and quick process that practically guarantees a performance boost.

Conclusion

Your site’s performance is nothing to be lax about. Narrowing down the factors contributing to your site’s slow loading times is just the first step. Tackling the causes is crucial to your site’s success.

In this post, we’ve looked at two content-related techniques for boosting your site’s performance:

  1. Remove query strings from static resources to enable caching.
  2. Reduce your site’s HTTP requests to increase efficiency.
    1. Reduce http content
    2. Optimize images
    3. Reduce external scripts
    4. Eliminate broken links

Do you have questions about how to improve your site’s performance? Let us know in the comments section below!

Featured Image Credit: Pexels.

Will Morris

Will Morris is a staff writer at WordCandy.co. When he's not writing about WordPress, he likes to gig his stand-up comedy routine on the local circuit.

3 Comments

  1. Shane Bishop

    Nice article… except for #1. You seem to be confusing static pages with static resources. “Resources” are things like JavaScript, CSS, fonts, images, and so on. Almost all of those things should be “static”, with some small exceptions.
    However, even GTmetrix no longer recommends removing query strings, as it was only a very old recommendation for very old/broken versions of the Squid proxy/cache system back in 2007.
    Query strings in this time are very useful for clearing caches. If you update your style.css and don’t have query strings, none of your previous visitors will get the new style.css. If a plugin updates a CSS or JS file, and you don’t have query strings, previous visitors will also not get the newer versions of those. Plus, if you use a CDN, query strings are a great way to invalidate the cache without having to flush your entire CDN.
    Additionally, W3TC is not an effective plugin to remove query strings, and that setting was only designed to prevent W3TC from adding more query parameters.

    So… please don’t remove query strings from your resources, they are very useful, and the 5 people using old versions of Squid won’t even know.

    The rest of the article is fantastic, even if you didn’t mention our own EWWW Image Optimizer 🙂 Reducing HTTP requests and optimizing images can be a huge win for performance. And Lazy Loading is just amazing for making pages smaller and lighter!

  2. Lauren Haas

    Thank you! Just adding your code snippet to my functions.php file made a significant difference in my Pagespeed score, I’m really glad I read this post.

  3. Kevin

    Nice article, thanks for the information. I’m going to try out some of these.

Leave a Reply

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

Over 65,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!

Have questions? Get in touch!

Over 65,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!



Have questions? Get in touch!

Over 65,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!



Have questions? Get in touch!

Over 65,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!



Have questions? Get in touch!