How can I speed up my WordPress site without plugins?

wordpress speed image

When you talk about website performance, every byte and second counts

Speaking about website performance, it only makes you want to increase the speed of your WordPress site. A responsive and high-performance website improves essential things like user experience and SEO, most notably. 

WordPress core is not heavy, but the themes, plugins you use may slow down the overall page load time. It’s always best to perform a technical audit on your site, and speed optimization should be a top priority. Users are always quick to move away from pages with poor page loading speeds, but you can use numerous online tools that offer detailed insights on your website speed performance.

WordPress speed optimization starts with your WordPress web hosting. 

Tackling the issue of a slow website by throwing more plugins into the mix, is rarely an absolute solution. So what else does it takes to improve your website speed without using more WordPress plugins?

Before we get into its depths and start implementing the different ways to boost the performance, let’s first understand why speeding up your WordPress website is essential.

Why you should speed up your WordPress website?

A poorly functioning admin panel will affect your work and your time efficiency when managing the website, especially as your dashboard might become challenging to handle.

Besides that, visitors won’t wait for your website to load either. If something is not working as they want it to, they’ll go away. And worse, many of them won’t ever come back.

study by Portent in 2019 revealed that the first 5 seconds of the page load time receive the highest conversion rates. It also revealed that conversion rates drop by an average of 4.42 percent with every second of load time.

In 2019, Unbounce found out that people would rather have quicker load times than fancy animations and videos on the site. In 2017, Google stated that the probability of a user bouncing off your site increases by 32% as page load time goes from 1 to 3 seconds.

If you’re not convinced yet, check out this research conducted by Think With Google, which revealed how adversely poor page load times could affect bounce rates.

Quick look into best practices for speeding your website

wordpress opitmization guide image
– Image Source: Techwyse

Now that you are entirely aware of why Website performance matters, let’s take a look at the steps you can follow to improve your site speed.

Ways to Improve WordPress website Speed.

Please note the codes to be added in functions.php unless specified differently.

1. Run a Speed Audit to measure the before speed of your site

To measure your website’s performance, we will need to capture the initial value or before your website’s speed score. We will make use of free online tools (websites) that can do this for us.

We recommend the two best tools regarding website speed optimization and give you the most helpful information; the first is Google’s PageSpeed Insights, and the second GTMetrix. These tools are of the industry standard and provide you a speed rating of your website’s performance with suitable suggestions telling you what aspects of your website need to be optimized for a better score.

Google’s PageSpeed Insights tool is a tool has a lot going for it. It’s pretty simple and provides you with the most critical speed improvement suggestions first. Not to mention it’s made by Google, which gives you a better representation of how Google rates your site performance when it comes to SEO.

If you are looking for a more detailed and technical interface aimed at more advanced users, it has to be GTMetrix. It provides a fairer representation of your website speed. I like to put it as if Google’s tool gives you a score based on your website’s overall speed (in terms of seconds loaded), but GTMetrix tends to compare it more on if you have done optimizations or not.

Begin by running your website on one of the speed tools. Keep this audit open in a tab while you are performing the operations on the other. Both tools are excellent at providing you performance insights. Regardless of the one you select, if you implement the following optimizations, your score will definitely improve.

2. Optimize Images without help of a Plugin

This is one of the most common issues with a website speed audit and one of the most important. Un-optimized images lead to a massive difference in download time because of the amount of data each picture has on your website.

The speed audit will point you to the images that have the most significant performance issue. Find where those particular disturbing images are on your website so we can begin optimizing them.

To optimize your images in WordPress without a plugin, we first need to find the rendered size. This is super important because why show an image that’s 3000 pixels wide if it only gets to be 1000 pixels wide? Lets look into how you can optimize the images.

How to Optimize Images

OOptimize WordPress Images
  1. Start by right-clicking the image that you want to speed optimized and click on Inspect.
  2. Once the inspect panel opens, find the image element or the <img src=”…”> thing and hover over the URL of it.
  3. As soon as you hover over the selected image, a preview/information window comes up. It will first state the size that the image is being rendered at and then the intrinsic dimension, which is the original size of the image that’s being loaded in.
  4. Next, we have to optimize the image. There are two quick ways to optimize your image size: The first being through WordPress’s image editor and secondly you download the image, put it into an image ccompression tool like TinyJPG, export it as a smaller size, then reupload.
  5. The final step is to replace the image with the updated size.

3. Enable browser caching in WordPress without plugins

Plugins like W3 Total Cache allow you to get cache enabled in seconds, it’s tempting to install them. However, a cache is something super simple to set up without a plugin. All you have to do is edit a specific file, paste in some code, and you’re done!

Ironically for this, you’re going to need a plugin or FTP access. We are going to edit a file called .htaccess.

To put it simply, the .htaccess file is used for configuring your web server settings surrounding the directory it’s in. This is why it’s used for caching because it’s the files in the directory we want the webserver to cache.

Editing the .htaccess file using FTP or Cpanel

The .htaccess file resides the root directory of the website which can be accessed using Cpanel or FTP. Once you locate the .htaccess file make a backup

The .htaccess file resides in the root directory of the website, which can be accessed using Cpanel or FTP. Once you locate the .htaccess file, download it to make a backup on your local system. The next step is to copy the code below and paste it into the .htaccess file at the bottom of the file. Make sure not to make any additional white spaces or line breaks.

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

4. Disable Hearbeat

WordPress uses heartbeat API to communicate with a browser to a server by frequently calling admin-ajax.php. This may result in slowing down the overall page load time and increase the CPU utilization if the site runs on shared hosting.

If you don’t have a requirement to use heartbeat API, then you can disable it by adding below.

add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
wp_deregister_script('heartbeat');
}

5. Remove Query Strings

Once you perform a site audit for your website for load time, you might have come across a suggestion to eliminate query strings from static resources (CSS, JS files).

Having query strings in the code may cause Content Delivery Network (CDN) not to cache the files; as a result, you may not be using all caching advantages provided.

To eliminate the query strings, add the following code.

function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
 $src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );

6. Deactivating unnecessary WordPress plugins

Since we discussed avoiding the plugins throughout the article, a WordPress article is incomplete without mentioning Plugins. Look through your activated plugin lists and simply deactivate the ones your website doesn’t need.

Even if you could deactivate at least 5 unused plugins it might increase the site performance by 30% on the Googles Page SpeedInsights tool.

The thumb rule is to go through every plugin and ask yourself:

  1. How actively is my site using this plugin?
  2. Will it impact the site majorly if I don’t use this plugin?
  3. Can I add this plugin feature myself with the help of CSS or JS?

I have also worked with websites having more than 30 plugins installed! That is just way too much for your system to handle. Remember, the plugins in WordPress are just used to make some of your tasks easier and not create the entire system using plugins. 

Ideally, you should aim for less than 10 plugins, though 15-22 can be acceptable if they are lightweight and you have enough speed optimizations in place.

Conclusion

After you have performed the above-said steps, try running another speed audit in a new tab to see the improvement in speed. You should definitely see a bump in speed from the previously done speed audit.

website speed test

These were a few of the solutions you can try and implement for improving the speed of the WordPress site. Read more about the capabilities of good web hosting and the types of it, check out this Ultimate Guide to Web Hosting 2021 by WebFlare.

If there’s something important I have missed, don’t hesitate to speak up in the comments.

About Author
Asad Qureshi

Asad is a frontend developer who believes in the synergy of rational and intuitive thinking. With a knack for creativity and a logical approach, he specializes in crafting visually stunning and user-friendly interfaces.

2 Comments

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.