HomeSEOHow to speed up...

How to speed up your WordPress Website: Tips And Tricks

It is always important to optimize WordPress website speed for a smooth and inspiring user experience. And search engines also love faster pages.

WordPress website Speed optimization

As we all love faster websites and want a speed WordPress website. All the websites owner and especially beginners should know the tricks through which they can boost their websites. I will focus on some important tricks which I experienced and got a much faster website.

So I will recommend you to take some important steps before you go further. If you are a beginner, you must read the Prerequisites section to avoid making problems and or crash your WordPress website.

Prerequisites

  1. Create a backup of the .htaccess file. (you can reload it if the changes break your website)
  2. Purge all cache and disable the cashing Plugin.
  3. Check your website by refreshing it to ensure it’s still working.
  4. Suppose you found that your website is not loading or not working. Find a possible solution for that error.

How to increase WordPress website Speed using the .htaccess file

First of all, we will take a brief overview of a list of .htaccess file tricks to enhance and increase speed. This list covers the major and recommended changes by most of the developers to increase website speed.

  • Compression (Gzip and Deflect)
  • Disable Image Hotlinking
  • Activate mod_pagespeed option
  • Enable light speed server cache

Enable GZIP compression

Compressing files on your local computer can save a lot of disk space. Similarly, for the web, we can use GZIP compression. This maneuver will dramatically reduce the bandwidth usage and the time it takes to gain access to your website. GZIP compresses various files so that whenever a visitor tries to access your website, their browser will first have to unzip the website. This process brings down the bandwidth usage to a considerable extent.

Check out: How Secure WordPress Site from DDoS Attacks

You can use either a plugin like the PageSpeed Ninja, enabling GZIP compression, or adding the following codes in your .htaccess file.

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

Disable Image Hotlinking

This trick is to restrict other sources from using your website images. There are huge chances that spammers can use your image link to their own website. Every time someone visits their page, the linked images will be loaded from your website/server. This is called image Hotlinking.

So you copy and paste the below code into your .httaccess file to prevent image Hotlinking.

# DISABLE IMAGE HOTLINKING START 

RewriteEngine on 
RewriteCond %{HTTP_REFERER} !^$ 
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sample.com [NC] 
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC] 
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L] # 

#DISABLE IMAGE HOTLINKING END

Active mod_pagespeed

This trick is to enhance and optimize your website, especially relevant, and works with Apache Server. Google develops the Mod_pagespeed module and now a few major hosting providers like DreamHost, SiteGround, and Godaddy to increase its page speed. However, this module could be installed using SSh on your Cpanel.

Copy and paste the below code to the .htaccess file to enable this module.

# ENABLE MOD PAGESPEED START # COMBINE CSS, COMPRESS IMAGES, REMOVE 
#HTML WHITE SPACE AND COMMENTS 

<IfModule pagespeed_module> 
ModPagespeed on 
ModPagespeedEnableFilters rewrite_css,combine_css 
ModPagespeedEnableFilters recompress_images 
ModPagespeedEnableFilters convert_png_to_jpeg,convert_jpeg_to_webp 
ModPagespeedEnableFilters collapse_whitespace,remove_comments 
</IfModule>

#End

LightSpeed Cache

Suppose you are using a lightspeed Server to run your website. You should use the below code to enable LightSpeed Cache Option.

# ENABLE LITESPEED CACHE START 

<IfModule LiteSpeed> 
CacheEnable public 
RewriteEngine On 
RewriteCond %{REQUEST_METHOD} ^GET|HEAD$ 
RewriteCond %{HTTP_HOST} ^sample.com|sample.net|sample.org [NC] 
RewriteCond %{REQUEST_URI} !login|admin|register|post|cron 
RewriteCond %{QUERY_STRING} !nocache 
RewriteRule .* - [E=Cache-Control:max-age=300] 
</IfModule> 

#ENABLE LITESPEED CACHE ENDerver level caching.

Important Note: – you should add/edit the mentioned module codes one by one in your website .htaccess file. Check your website every time you add/edit a module, so it will help you to know which module is not fit for your website.

Bonus tips and tricks

Reduce image sizes

Image is the major contributor to the size increment of a given webpage. The trick is to reduce the size of the images without compromising on the quality.

If you manually optimize the images using Chrome PageSpeed Insights extension or Photoshop or any other tools, the process will take a long time. Fortunately, there are plugins available for just about everything you can think of, including image optimization. The ones worth mentioning are:

Using any of the above-mentioned plugins on your WordPress site will drastically reduce image sizes, thus improving your website’s speed.

Use advanced caching mechanisms with a caching plugin.

WordPress caching plugins (e.g., W3 Total Cache) has been there for a long time, making the complex tasks of adding caching rules to your website elements easier. Combining such plug-ins with advanced caching mechanisms like Varnish could help you better your website’s loading speed and ultimately speed up WordPress considerably.

Use a CDN

The people who visit your website belong to various locations globally, and needless to say, the site-loading speed will differ if the visitors are located far away from where your site is hosted. Many CDN (Content Delivery Networks) help keep the site-loading speed to a minimum for visitors from various countries. A CDN keeps a copy of your website in various data centers located in different places. The primary function is to serve the webpage to a visitor from the nearest possible location. Cloudflare and MaxCDN are among the most popular CDN services.

Cleanup WordPress database

Deleting unwanted data from your database will keep its size to a minimum and reduce the size of your backups. It is also necessary to delete spam comments, fake users, old drafts of your content, and maybe even unwanted plugins and themes. All of this will reduce the size of your databases and web files and thus speed up WordPress – your WordPress.

Minimize external java scripts

The usage of external scripts on your web pages adds a big chunk of data to your total loading time. Thus, it is best to use a low number of scripts, including only the essentials such as tracking tools (like Google Analytics) or commenting systems (like Disqus).

Check out: Top 9 WordPress Tips That Are Worth Knowing

Most Popular

More from Author

What Are the Benefits of Conducting an eCommerce SEO Audit?

Conducting an eCommerce SEO audit may sound as exciting as watching...

The Benefits of Partnering with the Best SEO Company for Lawyers

When it comes to optimizing your law firm's website, there's no...

Top Tips to Help You Launch a Successful Website

Running a successful website is no small task. With the right...

The Benefits of Hiring an International SEO Consultant for Your Global Business

Are you thinking of expanding your reach when it comes to...

Read Now

Link Building vs. Link Earning: Striking the Right Balance for SEO Success

In the ever-evolving landscape of SEO, the quest for backlinks remains a cornerstone of achieving higher search engine rankings. Over the years, two main approaches have emerged: link building and link earning. While both strategies aim to improve a website's authority and visibility, they approach the process...

Local SEO marketing for service-based businesses: Strategies that convert leads to clients

We all are no strangers to the fact that building a fancy-looking website works wonders! It grabs the audience's attention and gives your business a new edge. It also helps you convert them into leads. Many people avail of the local SEO marketing strategies that provide different services at...

Scrapy Playwright: A Powerful Web Scraping and Automation Tool

Scrapy Playwright is an innovative tool that merges the capabilities of Scrapy, a fast high-level and powerful web scraping and crawling framework, and Playwright, a modern automation library from Microsoft. It is designed to overcome the challenges of extracting data from modern, dynamic websites using JavaScript, AJAX,...

What is a Traffic Bot? Complete Information

A traffic bot is a software application designed to mimic human online behavior and generate website traffic, often to boost visitor numbers and engagement metrics. These bots simulate actions such as clicking links, navigating web pages, and interacting with content. While traffic bots can be used for...

From Keyboard to Stage: The Magic of Online Speech Writing Assistance

Are you ready to dive into the captivating world of online speech writing assistance? In this article, we'll unravel the magic behind how these services can transform your thoughts and ideas into powerful, impactful speeches that leave your audience spellbound. From crafting persuasive narratives to mastering the...

How Conducting an SEO Audit Can Improve Your Online Presence?

A strong online presence can make or break a business in this digital age. Companies need to establish themselves online to ensure success. One of the critical elements to improving your online presence is search engine optimization (SEO). However, knowing where to start when optimizing your website for...

10 Things to Consider When Crafting SEO Strategies for Niche Businesses

As a business owner operating in the digital landscape, it's essential to have a comprehensive understanding of SEO. This understanding becomes even more vital when your venture is a niche business. With unique challenges and equally unique opportunities, navigating the SEO realm for a niche business requires...

7 ways Social Media Marketing can Boost Your Car dealership

Social media has undeniably become a cornerstone of our modern society, reshaping these practices. We can communicate, transform traditional marketing methods and enhance how brands connect with consumers. For a niche like a car dealership, leveraging social media marketing can help increase visibility, foster trust, and drive...

Share The Love: 5 Tips For Writing Awesome Guest Blogs That Will Perform Well.

When it comes to blogging today, you aren’t limited to just starting your own site and your own page, you can opt to write a guest blog instead. This has many benefits, including access to that site’s already existing visitors and the chance to talk about a...

10 Free online Plagiarism Checker Tools for Students

The definition of plagiarism is the unauthorized use of another person's ideas and information. The phrase refers to exhibiting someone else's work without acknowledging the original creator. Both in the academic setting and online, plagiarism has severe repercussions. To find plagiarized content in a paper or website, you...

Legal Due Diligence: Critical Questions to Ensure Regulatory Compliance in M&A

When engaging in a merger or acquisition (M&A) deal, conducting comprehensive due diligence is crucial to identify potential risks and ensure regulatory compliance. Legal due diligence is key in assessing the target company's compliance with applicable laws and regulations. Here are due diligence questions for M&A that...

How To Get Your Name On Top Of Google Searches?

As you know, Google is a popular search engine, and taking your brand name to the peak of its searches holds significant importance. Knowing how to get your name on the top of Google searches is critical. This is what a business, brand, or organization strives for,...