WordPress Speed Optimization: 23 Ways to Speed Up Your WordPress Site

Optimizing the speed of your WordPress website is vital for the success of your website. According to Google’s report, 53% of users will walk away from a website if it takes longer than 3 seconds to load. Not only can you can increase conversions by up to 27% by making just a one-second speed improvement on your website, speed matters for search engine rankings too.

WordPress Speed Optimization cover image

As the best CMS platform, powering 43.2% of all websites on the internet, WordPress lets you create beautiful-looking websites with impressive functionality. Getting a website up and running is one thing; making it perform well is a different challenge that needs a lot of attention.

If you are serious about taking your website to the next level, this WordPress Speed Optimization guide will help you.

Key Highlights:

Here’s everything you can expect to learn in this blog:

  • WordPress speed optimization is important for higher conversions.
  • Search engines like Google penalize slow websites.
  • Core Web Vitals is a useful metric for speed optimization in 2022.
  • Your web hosting plan may be crippling your WordPress website.
  • Running tests on an experimental website will gain you insight as you continue to fix issues one by one.

 

Why Should You Speed Up WordPress?

Your WordPress website is the face of your business. A faster website built with a user-friendly interface will:

  • Lead to higher conversions.
  • Reduce bounce rate.
  • Improve customer satisfaction.
  • Improve search engine rankings.

It is generally accepted for websites to load in under 2 seconds, whereas Google aims for under a half-second for a good response time.

As we mentioned, getting a WordPress website up and running is just the start. Your customers want to interact with a website that not only lays out the information they need but is also speedy. The load times of your web pages will determine not just customer experience but also search engine rankings.

Take this example for a second. You are an e-commerce store that wants visitors to convert to customers. The website lays out interesting information, including discounts on popular items. But the visitors don’t seem to buy those items. Why? As the visitors are browsing through, the web page response is slow, some images fail to load, and some components don’t work. And by the time the visitor adds something to the cart, it takes too long to check out.

The experience during this customer journey is enough for the customer to reflect on the purchase and leave without confirming the order.

The Importance of Website Speed for Mobile

People are doing more on their mobile devices than ever before. Therefore, search engines now prioritize mobile users over desktop users due to the proliferation of smartphones and other mobile devices.

The caveat, though, is that mobile data is expensive. Web pages are loaded with rich media that can consume a lot of data. If you are not optimizing your media for mobile, you are losing out on overall performance in a big way. For example, images uploaded in .webp format load quicker than their JPEG counterparts.

Make it a priority to optimize your WordPress website for mobile first, then move up to desktop.

A Few Words About Core Web Vitals

Core Web Vitals are metrics that Google has determined are vital for the best user experience. It determines a website’s speed, responsiveness, and visual stability. It serves developers to test their websites for search engine optimization.

Google rolled out Core Web Vitals in an update in 2021, making it an essential signal for search engine rankings. If you are new to building websites, it is important that you understand how these signals affect the user experience and your ranking in Google Search.

Here’s the breakdown of Core Web Vitals:

Final: How to Speed Up Your WordPress Site

Largest Contentful Paint (LCP)

A metric that determines how quickly the large images and blocks on a web page render from the time the user visits it. And as you would guess, the longer it takes for the web page to load, the worse your score will be.

A Good LCP score is 2.5 or less. It needs improvement if it is between 2.5 and 4 seconds. And a poor score is more than 4 seconds.

First Input Delay (FID)

Measures how long it takes for the website to become interactive as soon as it loads. It can be anything; clicking on a menu in the site’s navigation, a link on the home page, or typing text in a field. A responsive website should load quickly and become ready to interact instantly.

A Good score is under 100ms. It needs improvement if it is between 100ms and 300ms. And a poor score is more than 300ms.

Cumulative Layout Shift (CLS)

CLS measures the visual stability of your web page. Imagine for a second that you had second thoughts about the purchase and moved the cursor to click on the Cancel button under Confirm. But just as you hovered over it, the button moved due to an element like an ad, and you accidentally clicked on the Confirm button instead. It is how Google illustrates in Cumulative Layout Shift.

A Good CLS score is  0.1. It needs improvement if it is between 0.1 and 0.25. And a poor score is 0.25 or higher.

 

23 Ways to Optimize WordPress Site Speed

Let’s look at some ways you can optimize WordPress speed. We have categorized the techniques in order of difficulty. You can start out with methods that require no coding if you’re a beginner, or you can go up the difficulty ladder if you understand WordPress fundamentals.

Easy Steps (No Coding Required)

1. Choose a Fast Web Hosting Provider

At Host Advice, we understand the need for fast and reliable web hosting because it directly affects the user experience. The web hosting provider and hosting plan you buy affects your WordPress site speed.

Websites are run on servers, and your website will not perform well if those servers are not powerful enough. You need to ensure adequate computing resources available for your WordPress websites.

Here’s the breakdown of the types of web hosting plans:

  • Shared Hosting is the cheapest of all web hosting plans. It is aimed at people who want to run websites with low visitor traffic. Think of a company’s website that serves as a portfolio and a contact page for customers or a personal blog with only a few posts every month.
    In this type of hosting, resources are shared among other customers like yours. The server will use its CPU and RAM resources to accommodate all the websites assigned to it.
  • VPS stands for Virtual Private Server. It is a much more powerful solution for your WordPress website needs. The term virtual refers to how this web hosting is offered. If a server has dozens of CPU cores, they can be virtualized so that they can be partitioned and offered as a standalone server.
    VPS guarantees you will always get the computing resources you rent. So, even if multiple customers are using the same physical server, hardware resources have been compartmentalized for each user.
  • Dedicated Hosting is similar to VPS, but many more resources are available. The entire physical server belongs to you to be used in any way. It is also significantly expensive and not recommended for beginners or even moderate users. A VPS alone is a significant upgrade over shared hosting.

There is also Managed WordPress Hosting that comes preinstalled with WordPress and has some optimizations under the hood. But it falls under shared hosting.

Check out our list of the best WordPress Hosting.

2. Pick The Nearest Location

Latency refers to the time it takes for data to travel to its destination, then back to the source. Higher latency means slower performance. If your web server is farther, website performance will be slower.

Web hosting providers let you pick a location when setting up the server. Always choose the web server that’s closest to your target audience. For example, choose a server in North America if your target region is the United States or Canada.

3. Use a Fast Theme

Themes deliver a website’s visual makeup and functionality. WordPress themes that appear beautiful and impressive may actually be poorly coded, resulting in inefficiencies.

The themes could include dynamic elements, effects, and plugins that you don’t need but impact your website’s performance. A theme that is leaner under the hood will load up web pages faster. Pick a theme that is simple, then add functionality per your needs through WordPress plugins.

Best Practices

4. Optimize Images

Remember that the web server has to load everything on the web page, including images. Large images take longer to load and are not user-friendly. Optimize your images by using smaller versions and a different file format.

PNG gives the best quality, but the file sizes are big. JPEG is significantly smaller in size but has a difference in quality that most users are unlikely to notice. In comparison, the WebP format offers the same quality as PNG at 26% smaller size and is even smaller than JPEG in lossy format.

Ideally, you want the best quality and smallest size possible. Try our online image compressor. You can use image editing software like Photoshop or WordPress plugins like Imagify, ShortPixel, Smush, and Optimole.

5. Avoid Redirects

Redirect refers to linking a page or post to another. It helps when a page or post has been deleted or moved and returns a 404 error. Redirects may be unavoidable when you have many pages and posts, but they can impact your website’s speed. Try to structure your website’s architecture before solving everything through a redirect.

6. Disable Unused Plugins

Plugins are only useful if they are in use. The added functionality adds heft to web pages and can impact loading times. Not to mention they also bloat your database.

Learn How to Remove or Deactivate Plugins in WordPress.

7. Optimize WordPress

You can optimize your WordPress website using plugins like WP-Sweep. It will scan the database for things like deleted comments, spam comments, trashed posts, and revisions and wipe out the trash.

Cleaning up the database can shrink the total size of the database. We recommend backing up the WordPress database before running the plugin.

8. Disable Pingbacks and Trackbacks

As we previously mentioned, citations are standard practice on the web, which can also include backlinks to the source of information.

WordPress lets you know when you have received a backlink from another website. It also works the other way around. Getting notifications for backlinks is nice, but it adds more work to the web server due to the queries they generate. It can also be leveraged for DDoS attacks. So it’s in your favor to turn this off.

Final: How to Speed Up Your WordPress Site

From your WordPress dashboard, go to Settings > Discussion. Uncheck the option “Allow link notifications from other blogs (pingbacks and trackbacks) on new articles” under Discussion Settings.

9. Paginate Comments

If your website receives high traffic and generates discussions in the comments section, it can fill in pretty quickly. Trolling is often the internet’s way of discussion, dragging discussions further. Loading the comments on demand saves the web page from going that far. If the user is interested in comments, the load comments button under the post will open up the second.

Final: How to Speed Up Your WordPress Site

Open the WordPress dashboard, and navigate to Settings > Discussion. Find the option named Break comments into pages. Now, set the number of comments you want your website to show and the order of it. Check the box, then click on Save Changes.

10. Paginate Posts

Just like comments, you can paginate posts too. Instead of showing all the posts at once, you can break them down and display a set number of posts per page so that it’s digestible to the reader.

Long-form posts can also be broken into pages. It is helpful if your website tends to cover lengthy guides with lots of helpful illustrations and videos. This not only helps with loading times but also improves readability. Most themes have the feature to set the number of posts per page to display.

Advanced Strategies

11. Update PHP

PHP is a scripting language important for web development and makes server-side functionality possible. An update to PHP could bring performance improvements that result in faster website performance. It was certainly noted with the release of PHP 7, which brought a major performance boost over PHP 6.

Your hosting provider will automatically update to the latest PHP version if you use a managed WordPress hosting plan.

12. Enable Server-Side Cache

Cache has a significant impact on WordPress speed optimization. Whenever a user visits the website, the web server running WordPress will use PHP to query the website’s database to build the HTML file. To complete the web page, the web server must load every menu item, image, and functionality. This takes time and ultimately has an impact on loading times.

Enabling the cache will allow the website to build all the pages and save them to the server. So instead of building the web page into an HTML file every time, the server will bring up the cached HTML files instead, thus saving time to rebuild it for every user.

You can use WordPress plugins like WP Rocket, Super Cache, and W3 Total Cache.

However, certain pages are not cached, such as a check-out page on an e-commerce website.

13. Use Lazy Loading

It’s not just smaller image sizes that can help load web pages faster but also smart techniques like lazy loading. The technique loads the images that are visible on the user’s screen instead of loading all of them at once. The images will load as the user scrolls and they become visible.

Here’s an example from the Autoptimize plugin:

Final: How to Speed Up Your WordPress Site

It is a great way to improve WordPress site speed, especially if you have a lot of images. It also works for videos, iframes, and even Gravatar comments and images.

14. Minify CSS and JS

Cascading Style Sheet (CSS) is used to describe the visual presentation of a web page, such as fonts, colors, and spacing. Whereas JavaScript describes the behavior of the web page. Minifying CSS and JS can help with WordPress speed optimization. It will remove unnecessary code, spaces, line breaks, and comments from JS and CSS files to make them smaller.

A free WordPress plugin like Autoptimize or the WP Rocket plugin can do this job for you.

15. Use a CDN

A Content Delivery Network (CDN) is a good way to improve WordPress speed for users farther from the web server. The user will face slow page loading times due to higher latency. As your website grows, it may catch visitors from parts of the world outside your targeted region; thus, a CDN proves useful.

A CDN uses a data center to store a copy of your website and deliver it to users accessing from nearby locations. Netflix uses CDNs to deliver content faster to its global audience.

CloudFlare is one of the popular CDNs for such a purpose.

16. Uninstall Plugins the Right Way

WordPress plugins add functionality to websites, but they leave behind files even after they have been uninstalled. You can uninstall WordPress plugins at any time from the dashboard, but some of them might leave behind entries in the database.

You will need to access the SFTP server of your website and delete any leftover files. Plugin files don’t matter much but think about uninstalled plugin leftovers accumulating over time.

17. Limit Revisions

A neat feature of WordPress is that it keeps a copy of posts if you make any changes, just in case you need to revert. You can see this when you are editing a post or page in the WordPress dashboard. The changes you make will add to the revision count.

You can delete revisions by going into the website’s database. For future cases, limit the number of revisions. This will prevent too many revisions from increasing the size of the database.

Final: How to Speed Up Your WordPress Site

Access your WordPress installation via SFTP. From the root folder, open the wp-config file, then add the following line of code to the file:

18. Reduce Calls to Database

The WordPress database holds all the information about the website’s content. Themes not built with best practices in mind end up making mistakes like overusing database calls.

The server calls the database using PHP when the web page loads to fill in the information. But poorly-designed WordPress websites can make calls for information that can be fixed by static information. This requires technical knowledge and examination of the website’s code.

19. Object Caching

Object caching is caching for the database. It’s server-side caching that stores the results of database queries to avoid making queries to the database. The fewer queries your server has to make to the database, the less load it will bear.

The caching technique is useful for dynamic websites that need to make a lot of queries to the database to retrieve updated information.

With object caching enabled, subsequent users will be served a copy of the result of that request from the cache instead of querying the database.

20. Disable Hotlinking

Citations work on the web, and websites link to each other all the time. What matters is when another website leeches off resources from your server. If someone copies an image or video and inserts in another website using a URL instead of downloading it, the image/video will load from your website every time it’s displayed on that website.

define( 'WP_POST_REVISIONS', 3 );

Revisions will not matter as much if you have a small website. You can always revert by adding this line instead:

define( 'WP_POST_REVISIONS', false);

Your web server will work in the background for another website without your knowledge. It can have a big impact on your website’s performance if the other domain has high traffic.

This is known as hotlinking, and you can disable it by adding these lines of code to your WordPress .htaccess file.

Final: How to Speed Up Your WordPress Site

#disable hotlinking of images with forbidden or custom image option

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?hostadvice.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]

RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

Replace hostadvice.com in the fourth line with the name of your domain.

21. Enable GZIP Compression

Check the compression status of your website with our Gzip compression test. If you aren’t using GZIP, then you are missing out on good performance gains. It’s a lossless compression format for sending files over the network. Just as WinRAR compresses your files on a local disk, GZIP compresses files before they are sent over the network.

Once enabled server-side, it will translate to faster page load times and save bandwidth for the user because file sizes are much smaller.

Some plugins like WP-Optimize enable GZIP compression, but you can also enable it by adding these lines of code to 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

22. Leverage Browser Caching

We discussed saving cached copies of web pages on the server, but you can also store static assets on the user’s web browser. The web browser will use its cache to load those assets instead of requesting them from the server, thus improving page load times.

You can set the expiry for HTTP headers which will tell the browser how long to cache the CSS, JavaScript, and other elements.

Managed WordPress hosting plans include such optimizations, so you don’t have to tinker with the core of your website. Some plugins like WP Rocket that are built to improve website performance also include caching techniques.

There are two things you need to do: add expire headers and enable cache control. Edit your .htaccess file via SFTP access and add the following lines of code on a server running Apache:

##For expires header##

<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 image/svg "access 1 year"

ExpiresByType text/css "access 1 month"

ExpiresByType application/pdf "access 1 month"

ExpiresByType application/javascript "access 1 month"

ExpiresByType application/x-javascript "access 1 month"

ExpiresByType application/x-shockwave-flash "access 1 month"

ExpiresByType image/x-icon "access 1 year"

ExpiresDefault "access 3 days"

</IfModule>

##For expires header##

Now add the following code:

##For cache-control##

<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|svg|js|css|swf)$">

    Header set Cache-Control "max-age=96000, public"

</filesMatch>

##For cache-control##

23. Eliminate Render-Blocking

One of the things you might have noticed when running Google PageSpeed is the insight that you need to eliminate render-blocking resources. So, what does it mean?

The web browser starts rendering the web page from top to bottom of your code. It will try to load and process any JS or CSS files in the code. JavaScript is essential, but not all files would be relevant and need to be loaded. If a conditional file, like a JavaScript file for the footer, gets in the way, it will eat up time that should have gone to elements in the user’s view.

To put it more plainly, elements present way down on the page will load up before elements that are visible on the user’s screen.

Async and defer are the two methods to eliminate render-blocking. Async does not stop the rendering but downloads the JS and CSS files asynchronously with the HTML parsing, then parses them. Defer will download the JS and CSS files but not parse them until HTML parsing is finished.

Final: How to Speed Up Your WordPress Site

Using the Autoptimize plugin is the easiest way to eliminate render-blocking. Download the plugin, then enable Optimize JavaScript Code and Optimize CSS Code from its settings.

 

How To Speed Up Your WordPress Site (Table)

ComponentsBest Practices
Images
  • Optimize your images
  • Enable lazy loading
  • Make your favicon small and cacheable
  • Avoid resizing images in HTML
JavaScript
  • Eliminate render-blocking JavaScript
  • Minify JavaScript
  • Limit external scripts
Server
  • Rely on fast hosting
  • Use a CDN
  • Leverage server-side caching
  • Enable expires and cache-control headers
  • Limit external HTTP requests
  • Use GZIP compression
  • Minimize DNS lookups
  • Configure ETag and last-modified headers
Content
  • Limit number of revisions
  • Cleanup WordPress database
  • Minimize redirects
  • Optimize for visible content
  • Minify HTML
  • Paginate pages and posts
  • Disable hotlinking
  • Reduce the number of DOM elements
  • Create cacheable AJAX
CSS
  • Minify CSS
  • Eliminate render-blocking CSS
  • Optimize CSS
  • Avoid CSS expressions
  • Optimize CSS sprites
Cookie
  • Reduce cookie size
Mobile
  • Pack components into a multipart document
  • Target 25KB for page components

 

How To Check Your WordPress Site Speed?

Search engines like Google greatly emphasize the speed of your web pages. Regardless of how it feels to you, your website will always be measured against the best practices in the industry. Your website may feel fast to you because of the cache from your frequent visits, but you have to think from the user’s perspective.

As we mentioned, an acceptable page load time falls under 2 seconds. Whereas Google targets 0.5 seconds at least.

Several factors contribute to page load times. The number of elements on the page, whether it’s cached or not, static or dynamic content, and how many requests it generates. As you continue to fix aspects of your website, from server level or content, your speed scores will improve by milliseconds. And ultimately add up to half a second or more in speed improvement.

  • Google PageSpeed is a popular way to run WordPress speed tests.
  • You can also use Web Page Test and Pingdom.
  • Remember how we talked about building for mobile-first? Here’s a tool that measures mobile friendliness.

Website speed test tools will let you choose the region. Pick the region closest to your web server.

 

What Slows Down Your WordPress Website?

Without running a test, you will be unable to figure out what slows down your WordPress website.

The insights tools like Google PageSpeed deliver will point you to the culprits. But more often than not, it’s due to things that relate to JavaScript, CSS, HTML, and server-side elements. You also can’t outrun a slow hosting provider.

Poorly-built themes are another reason. A theme consists of the visual layout and how those elements come together. If the WordPress theme is not properly coded to avoid redundancies, it will affect how your web page loads.

In a nutshell, here are the factors that slow down your WordPress website:

  • Slow web hosting
  • Unoptimized images
  • Unoptimized JavaScript and CSS
  • Heavy web pages
  • Inefficient themes
  • Excessive third-party scripts
  • Not utilizing page cache
  • Not using compression
  • Using too many WordPress plugins

 

WordPress Site Types: Static or Dynamic

You can tackle the challenge of optimizing for speed by considering what type of WordPress website you are running.

For simplicity, you can classify websites into Static and Dynamic. It’s important because that will help you understand what changes need to be made to support the website’s niche.

Static

  • Fixed number of pages that remain the same for every visitor.
  • The content on the web pages does not respond to the user’s interaction. (In more technical terms, each page is stored as an HTML file and gets retrieved on request. It does not change for every user.)
  • You can add images, videos, and some cool animations to build, but those elements are the same for everyone.
  •  A static website doesn’t account for the user’s browsing history or location.
  • Caching the pages is easier since the content does not change very often.
  • Performs faster than dynamic websites because HTML pages are prebuilt and loaded the same for every user

However, personalization isn’t necessary for certain websites. A portfolio website, a company’s website, or a personal blog doesn’t need dynamic elements.

Dynamic

  • Highly-personalized and have content that changes frequently.
  • Dynamic websites don’t use stored HTML files for every page but build them as they are requested. The server will pull updated information from the database and build an HTML web page file for the specified user.
  • Because the server is not feeding prebuilt HTML pages, it is possible to show updated and tailored web pages for each user.

Some examples include:

  • An e-commerce website adjusts the recommended products on the home page based on the user’s location or shopping history.
  • A web page can be in multiple languages and change based on the user’s selection.
  • Social media platforms generate a feed based on user-generated content, liked accounts, and new and viewed stories. The feed is dynamically built based on the user’s interaction. If the user blocks an account, refreshing the feed will not show updates from the account.

Dynamic websites require more work by the server, meaning more resources must be available. A slow web hosting plan will certainly crumble under the weight of all that functionality.

 

Wrapping Up

It starts with your choice of web hosting and we cannot stress enough how important it is for your WordPress website. Web hosting providers are a dime a dozen, but only a few are worth your money. Get the complete rundown on the best WordPress hosting providers in our blogs. Additionally, you can read individual reviews on hosting providers for performance scores.

We think that unless you expect to receive at least a million users per month on the website and security is paramount, a dedicated hosting solution is not needed. You can always scale up a VPS solution if you need.

Once you have decided on a good hosting plan, then install WordPress to get started. To recap things, your theme should be lightweight and properly coded. It will serve as the foundation for the tips shared in this guide.

 

Next steps: What now?

  • If you have an existing website, use the website speed test tools to determine the areas where it lacks.
  • You can also build a small website and experiment by fixing identified issues one by one, then gauging the effects of those changes.
  • Refer to the theme’s documentation for any recommendations by the developer on how to make the website faster.

 

Further Reading

We have created some very useful WordPress tips and guides for you.

  1. Find the best WordPress hosting services in 2022
  2. What is WordPress? An Overview of the World’s Most Popular CMS
  3. How to install WordPress: Choose one of four methods
  4. How to use WordPress? Make your first WordPress website
  5. How to login into your WordPress admin?  
  6. What Are WordPress Plugins And How To Manage Them?
  7. What Is a WordPress Theme: A Full Overview and How to Choose One
  8. What are WordPress Widgets? What They Are and How to Use Them

FAQ

How can I speed up my website quickly?

Add the WP-Optimize plugin to enable GZIP compression, use a plugin to enable server-side caching, and optimize your images using a plugin like Smush.

How can I speed up my website without plugins?

Optimize your images, paginate your posts, enable browser-level caching, and update to the latest PHP version.

What’s the best plugin for WordPress Speed Optimization?

We recommend using WP Rocket for WordPress speed optimization. It features many options that can tweak your website without having to modify or add code. It can enable page caching, GZIP compression, minify JS, CSS, HTML, and more.

How can I edit WordPress files?

You need access to your PHPMyAdmin database. Go into your web hosting account for SFTP credentials or ask customer support. Use any FTP software, such as FileZilla, to connect to your WordPress website. You can now edit the core WordPress files like .htaccess.