How to Speed Up a WordPress Website

How to Speed Up a WordPress Website

Having a fast site is crucial for any project or business.

Not only does a slow website leave a bad impression on visitors, but it also makes it more likely for them to leave the website. Pages that load in one to five seconds increase the probability of a bounce by 90%.

Additionally, search engines like Google consider page speed to be a ranking factor. Slow websites will find it more difficult to get discovered organically.

Fortunately, there are ways to fix a slow site. In this guide, we will explore 11 actionable steps that can significantly speed up WordPress websites. Backed by expert insights, you will learn valuable tips and get a deeper understanding of WordPress speed optimization.

Pick a Suitable Hosting Plan For Your WordPress Website

First, make sure to use a reliable hosting provider and a plan that can meet your website’s requirements. A poor quality web host and an inadequate hosting plan can cause your website to be slow, among other issues.

The key is to never skimp on proper research when choosing a hosting provider and plan. Identify your website’s needs, then find a web host and plan that fulfills them best.

Make sure the hosting company you choose has a proven track record of offering excellent WordPress performance and customer support. Some hosting providers offer unique features to speed up WordPress.

Hostinger, for example, has a cache manager feature on hPanel and uses LiteSpeed to optimize server performance and load times.

LiteSpeed’s asynchronous architecture can handle higher traffic and concurrent connections better than web servers that use Apache. Instead of creating a new request every time, LiteSpeed stores compressed cache files which optimizes page speed.

LiteSpeed also comes with a WordPress caching plugin that can accelerate website speed even more. Unlike other caching plugins, LiteSpeed directly integrates with the web server, allowing it to remember entries and analyze dependencies for more intelligent cache management.

Once you’ve chosen a hosting provider, it’s time to select the most suitable plan for your WordPress site. In general, hosting providers offer a variety of hosting types, such as:

  • Shared hosting. An entry-level type of hosting that stores different websites on the same server, sharing its resources. Hostinger’s shared hosting plans start at $1.39/month.
  • Cloud hosting. A premium type of hosting that offers dedicated resources from a network of multiple servers. It’s as simple to use as shared hosting. Hostinger’s lineup of cloud hosting plans starts at $9.99/month.
  • Virtual Private Server (VPS) hosting. A type of hosting that gives users root access and dedicated resources. It requires some technical expertise to set up and maintain. Hostinger’s VPS hosting starts at $3.95/month.
  • WordPress hosting. A type of shared hosting specifically designed for WordPress when it comes to website performance and security. Take a look at the following table for a detailed breakdown of Hostinger’s WordPress hosting plans – from the pricing to allocated hosting server resources:
Single WordPressWordPress StarterBusiness WordPressWordPress Pro
Pricing$1.99/month$2.99/month$5.99/month$11.59/month
Number of websites1100100300
SSD storage30 GB100 GB200 GB200 GB
Bandwidth100 GBUnlimitedUnlimitedUnlimited
Monthly traffic~10,000~25,000~100,000~300,000
Free domainNoYesYesYes
Free SSLYesYesYesYes
Email accounts1100100100
MySQL databases2UnlimitedUnlimitedUnlimited
Daily backupsNoNoYesYes
Subdomains2100100300

To get the best WordPress performance and load times out of your chosen hosting plan, don’t forget to consider your goals, the amount of content you want to upload, and your anticipated amount of traffic in advance.

While it’s only natural to want to save money when you can, hosting should be a top priority in your budget. It’s a fundamental investment that will determine how well your WordPress site will perform.

Ideally, the plan you choose should have enough resources for daily use and leave a little headroom for upgrades and days when you might get unexpected high spikes of traffic.

This way, you won’t have to worry about suddenly running out of storage or your website going down when traffic is high. Moreover, if you use shared hosting, outgrowing a hosting plan’s allocated resources can also negatively impact other sites on the server.

Choose the Closest Server Location to Your Target Audience

The location of your server determines how fast it can transfer and receive requests to load your website. While many advancements have been made to improve connection speeds, latency is still an issue.

Latency is the amount of time taken by web servers to receive and process a request for a web page. A significant factor that influences it is the physical distance to the server.

Web requests and data travel from server to server until they arrive at a user’s browser. If a server is far away, latency will be high and it will take much longer to load web pages on the browser.

High latency slows down websites and worsens the overall user experience. It’s significantly worse if the website has a lot of heavy content, such as images, animations, and videos. Latency becomes a more serious issue for users with slow or unstable internet connections.

Hostinger has six data centers located around the globe. When you sign up for a hosting plan, make sure to pick the server location that’s nearest to your target audience. If you already own a website and would like to change your server location, contact support to do so.

However, you might not be aware of the location of the majority of your audience. To view a detailed report on your website traffic, including the location of your visitors, use Google Analytics.

The most commonly used Google Analytics plugin on WordPress sites is MonsterInsights. Installing MonsterInsights will add Google Analytics to your WordPress site, and you’ll be able to view your website traffic metrics straight from the WordPress admin dashboard.

If you use Hostinger and find yourself having to switch to a different server location, follow these simple steps:

  1. Log in to hPanel and find the Server section in the sidebar.
  2. Click the Edit button.
Server section on the hPanel
  1. A new window will pop up. From the drop-down menu, select the server location you would like to migrate to. Note that you’re only allowed to initiate one server transfer per month. Click Next to proceed.
Changing the server location on hPanel
  1. In the final step, select Start.

Keep in mind that it can take up to 12 hours before the server migration is complete. We don’t recommend making changes to your WordPress site during the process as they won’t be saved.

Once the website is fully transferred to the new server, the IP address associated with your hosting plan will be renewed.

Use a Content Delivery Network

A content delivery network (CDN) is a network of geographically distributed servers that work together to speed up the process of delivering websites to users’ browsers.

It’s the perfect solution for a global WordPress site with target audiences located in different locations. A CDN shortens the distance between the user and the server, significantly reducing latency and increasing page speed.

A CDN works by saving copies of a website’s static content in the cache. When a user visits the website, the server closest to them will load the content, reducing the number of external HTTP requests.

Illustration of how a CDN works

There are different CDNs that you can sign up for. Some WordPress hosts offer CDN bundles with their hosting. Hostinger, for instance, uses Cloudflare, one of the best CDNs on the market.

To activate Cloudflare with an eligible Hostinger plan, log in to hPanel and go to Domains -> Cloudflare.

On the hPanel, select Cloudflare

In the Cloudflare Control section, switch the Service status on. Then, select your preferred options for SSL / Encrypt communication and Security level. Click Save.

Cloudflare control section on hPanel

Once Cloudflare is enabled on your hosting, install and activate the Cloudflare WordPress plugin. It will let you configure your CDN’s settings right from the dashboard.

If your Hostinger hosting plan doesn’t come with a CDN, you’ll have to purchase it separately first before enabling it.

Deliver Content Over HTTP/2

Hypertext Transfer Protocol (HTTP) is the foundation of data communication on the World Wide Web. It’s how clients and servers exchange information.

For example, when someone wants to visit yourdomain.com, their browser sends an HTTP request to a remote server that will process it and load the website’s content.

The first iteration of HTTP, HTTP/1, is quite effective. However, it’s considerably slower compared to the newer version, HTTP/2.

Here are some of the advantages HTTP/2 has over HTTP/1:

  • Efficient communication. HTTP/2 uses a binary protocol designed for communication between machines. Compared to HTTP/1’s use of a text-based protocol, binary data is significantly simpler to process.
  • Weighted prioritization. With HTTP/2, the website developer can decide which content should load first. This feature lets browsers load lighter content like text first, giving the impression that the website is loading faster.
  • Multiplexing. With HTTP/1, the browser can only load elements one by one. HTTP/2 improves on this by letting browsers load different types of content in a single connection.
Scheme showing how multiplexing works
  • Server push. HTTP/2 lets servers send content before the browser requests it.
  • Advanced compression. Compared to HTTP/1, the compression HTTP/2 uses, HPACK, can eliminate redundancy in exchanged HTTP packets. HPACK makes HTTP messages smaller, which shortens load time.

Fortunately, most WordPress hosting providers already use HTTP/2 by default. There’s no need to manually initiate a migration because LiteSpeed, the web server software used by Hostinger, natively supports HTTP/2.

WordPress hosting providers that use Nginx servers also support HTTP/2 natively, while Apache servers have added support for it in 2015. If your web host uses Apache, contact them to confirm whether HTTP/2 support is available.

However, if you’re unsure whether your WordPress site uses HTTP/2, use the HTTP/2 Test Tool and HTTP2.Pro to check. If it turns out that your website still uses HTTP/1, check whether your web host offers HTTP/2 and contact them to initiate the migration.

In addition, keep in mind that installing an SSL certificate is highly recommended for HTTP/2, as nearly all browsers only support HTTP/2 via an encrypted connection.

Choose an Optimized WordPress Theme

The WordPress theme you use can influence your website’s speed. It’s essential to choose a well-optimized theme to speed up your WordPress site.

Look out for the following criteria to choose a fast WordPress theme:

  • Optimized code. To prevent any performance or security issues, make sure that the theme’s code abides by the World Wide Web Consortium (W3C) and WordPress standards. Use tools like the HTML Markup Validation Service and the free plugin Theme Check to validate a theme’s code quickly.
  • Lightweight. A lightweight theme only comes with the necessary features. Its code should have minimal clutter, and the JavaScript and CSS files sizes should ideally be under 100 KB. The default WordPress themes generally fall into this category.
  • Browser compatibility. Unfortunately, not all WordPress themes can perform well across different browsers. Choosing a cross-browser compatible theme lets you offer the best experience for any user.
  • Mobile responsiveness. When a theme is mobile responsive, it can adapt to mobile screens without slowing down. With over half of all web traffic originating on mobile devices, responsiveness is important to ensure accessibility and attract visitors.
  • AMP-ready. The Accelerated Mobile Pages (AMP) technology lets WordPress sites load faster on mobile devices. Choosing an AMP-ready theme can significantly improve the speed of your mobile site.

Before installing a theme, make sure to try its demo website. If the theme is free, install and activate it on your website as it is without any additional content. Then, test its speed using a tool like PageSpeed Insights.

To do so, head to the PageSpeed Insights website, enter your site’s domain name, and click Analyze.

Analyze your site on PageSpeed Insights

In addition to scoring websites based on their performance, PageSpeed Insights also offers actionable insights on improving a website’s speed optimization.

Pingdom and GTmetrix are other popular website speed tools you can use to check your WordPress site’s performance with the applied theme.

If the website turns out to be slow when tested, it means that the theme you’re using is poorly optimized. Try other WordPress themes until you get the ideal page speed.

Optimize Images

Images are vital to a website’s aesthetics. They’re one of the best ways to attract attention, show off a product, or evoke a particular emotion.

However, large images can significantly contribute to a page’s size, slowing download time. According to HTTP Archive, in August 2021, images made up around 45% of an average page’s total size. This is much more than CSS, font, and HTML files combined.

Here are some tips to optimize images and speed up WordPress:

  • Make sure the file size is 500 KB or less. Before uploading any image, check its file size. In general, images larger than 500 KB load noticeably slower. Use a tool like TinyPNG to compress images.
  • Use the recommended file format. Different image formats use different file compression methods. As a result, some file formats are more suitable for specific uses than others. Here are some of the most common image file formats and what they’re best for:
    • JPEG. JPEG uses a lossy compression, which means some information will be lost in favor of smaller file size. JPEGs are best for sharing photographs.
    • PNG. PNG uses lossless compression that retains all information within an image, ensuring the best resolution. PNGs are recommended for graphics and drawings.
    • WebP. WebP is gaining popularity due to its ability to combine lossy and lossless compression. By using WebP, you’re able to offer a high-resolution image that’s smaller than a JPEG or PNG file.
  • Use the proper display size. Avoid uploading high-resolution images and resizing them on WordPress later. While they will look smaller, machines will still have to download the entire file from the server, taking up more bandwidth space. If you need to feature 2000 x 1000px images, it’s best to resize them to that exact size before uploading.
  • Lazy load images. When lazy loading is enabled, images on a page will load on-demand. This improves site speed because the website doesn’t have to load all the images at once, only when the user scrolls down to view them.

We recommend installing an all-in-one image optimization plugin such as WP Smush for a quick and straightforward solution. WP Smush lets you compress and resize images in your WordPress media library in bulk and features lazy loading.

Additionally, the Pro version of WP Smush lets you convert images to WebP.

Suggested Reading

Read our article on the comparison between lossy vs lossless images to see which one can improve the loading speed of your site!

Update WordPress Core, Plugins, and Themes Regularly

By keeping up with WordPress software updates, you will make sure that your website always has the latest performance and security improvements. Security and performance are interconnected – if a WordPress site is vulnerable, it can be slowed down or even become unusable.

As an open-source platform, WordPress unfortunately attracts hackers who are constantly looking for security vulnerabilities. As a result, keeping WordPress up-to-date is all the more important.

Luckily, since WordPress 5.5, auto-updates for WordPress core, plugins, and themes can easily be enabled straight from the dashboard. That said, you still have the option to update them manually.

For WordPress core, you can enable auto-updates for minor upgrades only, which we recommend for most users. Major updates may add significant changes that might not suit your WordPress site.

To choose how your WordPress core software should auto-update, log in to your dashboard and navigate to Updates.

  • If minor auto-updates are already enabled, you will see a message that says This site is automatically kept up to date with maintenance and security releases of WordPress only.
  • If you want to enable major auto-updates, click Enable automatic updates for all new versions of WordPress. Once this is enabled, the message This site is automatically kept up to date with each new version of WordPress will appear.

Alternatively, if you use Hostinger, you have the option to enable WordPress core auto-updates from hPanel. To do so, go to WordPress -> Dashboard. Under Core, find WordPress Updates and click Change.

WordPress Core Updates section, highlighting Change

On the new window, choose the auto-update option you prefer. In this example, we’ll leave Only update minor versions, the default setting. Finally, select Save.

Manage WordPress Update Settings window

To update a plugin, log in to the dashboard and go to Plugins -> Installed Plugins. Find the plugin you wish to update and select Update now. Alternatively, you can choose Enable auto-updates from the Automatic Updates column.

Enabling auto-updates for a WordPress plugin

However, to be safe, it’s always recommended to read the new version’s changelog before updating any plugin. This is especially vital if you have a large website that handles a lot of traffic.

Security updates are generally safe to apply right away. However, feature updates can have bugs that affect usability and performance. A good rule of thumb is to wait a week before applying any feature update. By then, any known issues should already be fixed by the developers.

To update a theme, go to Appearance -> Themes and click the theme you want to update. To manually update the theme, select Update now. Alternatively, you can also select Enable auto-updates.

Enabling auto-updates for a WordPress theme

Like with plugins, be careful when applying updates. Checking the notes on the new version is also highly recommended before updating themes.

Another tip is to use a child theme. A child theme inherits its parent theme’s features but lets WordPress users modify it without changing the parent theme. As a result, applying parent theme updates will retain the modifications you’ve made to the child theme.

If it’s a big update, whether for WordPress core, plugin, or a theme, you might want to set up a staging environment to test it before applying it to your live website. This can be done manually or by using a plugin like WP Staging.

Uninstall Deactivated Plugins

Plugins extend the functionality of WordPress, making them great additions to a website. However, some plugins can be resource-intensive, taking a toll on the performance. That’s why you should avoid having too many WordPress plugins, making sure to remove the ones you no longer use.

Deactivating a plugin is not enough because it’s still attached to your WordPress site. You have to delete unused plugins from WordPress completely.

Fortunately, removing most plugins is simple. From your dashboard, go to Plugins, locate the deactivated plugin, and select Remove.

Inactive plugins may leave some leftover database queries and WordPress configuration, which requires some extra steps to completely remove. This is common with security or caching plugins.

Before you remove a deactivated plugin, check the plugin’s official documentation that covers how to uninstall it properly. For example, Yoast SEO has a comprehensive article about how to uninstall their plugin completely.

If the plugin doesn’t have an in-depth uninstallation guide, you’ll have to manually remove its leftover settings and database files.

To avoid having to uninstall WordPress plugins frequently, try to be more selective and intentional about installing plugins in the first place:

  • Always vet the developer first. Ideally, the developer should have a track record of creating good plugins and responding to user feedback. They should also update the plugin regularly.
  • Use trustworthy marketplaces. If you want to install a plugin from a third-party source, make sure it is reliable, such as CodeCanyon. Unreliable sources are more likely to feature poor-quality plugins that may even include malware with them.
  • Only install the necessary plugins. Before installing any plugin, ask yourself whether it’s essential to your website. The fewer plugins you have, the lighter and faster your WordPress site will be.

Fewer plugins result in better performance. However, plugin quality is equally as important. One poor-quality plugin can cause devastating performance issues. Therefore, it’s imperative to conduct proper research beforehand.

Minify HTML, CSS, and JavaScript

If you’ve ever opened a CSS, HTML, or JavaScript file, you will notice that some have a ton of spaces, line breaks, comments, and redundant characters. Although this makes these files more readable to other developers, it’s clutter, which makes the site load slower.

Minifying CSS, HTML, and JavaScript files means removing unnecessary characters to reduce the file sizes. You can speed up WordPress with smaller files because data transfers between servers and browsers will be quicker.

Take a look at the following graphic for a comparison between a non-minified and a minified file.

Graphic comparing minified and non-minified files

There are two main ways to minify a JavaScript, HTML, or CSS file:

  • Use an online tool. The website MinifyCode has tools that let you automatically minify the content of JavaScript, CSS, and HTML files. All you have to do is replace the old files with the minified versions.
  • Install a minifying plugin. Several plugins let you minify HTML, JavaScript, and CSS files – one of them is Fast Velocity Minify. In the plugin’s settings, simply select the file types you want to minify.

File minification is one of the easiest and most effective ways to optimize website performance. Often, it shrinks file sizes by about 40-60%. Caching plugins like LiteSpeed, W3 Total Cache, and Autoptimize also offer minification functionality.

Use the Latest PHP Version

PHP is a scripting language that lets developers create dynamic, interactive websites. According to W3Techs, PHP is used by 78.4% of all websites with an identifiable server scripting language. The WordPress CMS and all websites built on it are written in PHP.

Like any other software, PHP has been constantly updated since its first release. Each new version of PHP introduces performance and security enhancements. The latest PHP version is 8.0, which is also supported by Hostinger’s hosting plans.

According to a benchmark test by Phoronix, PHP 8.0 performs 10% better than its predecessor, PHP 7.4. It comes with many new features and optimizations, improving the language’s efficiency.

One key new feature of PHP 8.0 is the just-in-time (JIT) compilation. In simple terms, JIT lets PHP 8.0 compile a program into machine code immediately before execution. With tracing JIT compilation enabled, PHP 8.0 performance on WordPress is even faster.

Currently, WordPress supports PHP 7.3 or higher. Unfortunately, a large chunk of WordPress websites 32.38%, to be exact – are still using a version of PHP that’s no longer supported by WordPress. Additionally, only 1.54% of WordPress websites use the latest version of PHP.

If you’re still using an old version of PHP, you will be missing out on new features, performance improvements, and security patches. In addition to increasing your WordPress site’s speed, updating PHP will also ensure its overall security.

Most WordPress hosting providers allow you to change your PHP version from the hosting control panel. To change the PHP version in Hostinger, follow these steps:

  1. Log in to hPanel and navigate to Advanced -> PHP Configuration.
Select PHP Configuration on the hPanel
  1. On the PHP version tab, select the version you prefer and click Update.
PHP version tab, highlighting Update

Before upgrading the PHP version, make sure that your WordPress website’s code is compatible with the version you are upgrading to. It’s recommended that you try to upgrade the PHP version in a staging environment first. This is the best way to decrease the risk of your site crashing.

Optimize the WordPress Database

A database is where all your website information is stored – from posts and pages to theme and plugin settings. WordPress uses MySQL as its default database.

Over time, your WordPress database might accumulate unnecessary information that bloats your website. Unnecessary data may include post revisions, deleted comments, old plugin settings, and unused tags.

If left alone, a bloated database will make it harder for servers to retrieve specific information quickly. This will take a toll on the website’s performance, reducing its overall speed. In contrast, a well-optimized database can respond to queries faster.

Fortunately, there are ways to optimize your WordPress database.

The first method is to use phpMyAdmin. phpMyAdmin is an open-source database management system bundled with many hosting accounts, including those offered by Hostinger.

  1. On your hosting account, open phpMyAdmin. If you use Hostinger, open hPanel and go to Databases -> phpMyAdmin.
On the hPanel, select phpMyAdmin
  1. Under the List of Current Databases, select the database name you want to optimize and click Enter phpMyAdmin.
  2. Once redirected to phpMyAdmin, choose the database name from the navigation sidebar.
Select the database name
  1. Click the Structure tab, then scroll down until you reach the bottom of the table and select Check all.
  2. In the drop-down menu, choose Optimize Table.
Select Optimize Table
  1. When the process is finished, you will receive a message that says, “Your SQL query has been executed successfully.
Success message: “Your SQL query has been executed successfully.”

The second method is to use a WordPress database plugin, like WP-DB Manager.

  1. From your WordPress admin dashboard, install and activate WP-DB Manager.
  2. Go to Database -> Optimize DB.
  3. Choose Yes for all the database tables you want to optimize.
  4. Select Optimize.

Database optimization is the riskiest optimization method. If done improperly, you risk accidentally breaking your website. It’s essential to backup your database before optimizing it.

Speed up Your WordPress Site Today

A slow WordPress website will frustrate visitors and negatively affect search engine rankings. Having a speedy website is essential to ensure a good user experience and search engine optimization.

In this guide, we have explored 11 methods to speed up WordPress:

  1. Pick a suitable hosting plan for your WordPress website. Make sure to choose a reliable hosting provider and a hosting plan with sufficient resources for your needs. Checking what server software your provider uses and setting it up properly can also influence your WordPress site speed.
  2. Choose the closest server location to your target audience. The further your server is from your visitors, the slower your site will load. If you’re unsure where most of your audience is, use Google Analytics to find it out and switch your server location accordingly.
  3. Use a content delivery network. A CDN will let you distribute your website’s content through different servers around the world, ensuring the best site speeds for a global audience. Some hosting plans come with a CDN, while others let you install it as an add-on.
  4. Deliver content over HTTP/2. HTTP/2 is the new and improved version of HTTP. It has more features and is faster than HTTP/1. Fortunately, most hosting providers use HTTP/2 by default. If you’re not sure if your WordPress site uses it, check by using the HTTP/2 Test Tool or HTTP2.Pro and contact your WordPress host for assistance.
  5. Choose an optimized WordPress theme. A poorly optimized theme can cause your site to load slowly. To ensure the best loading speeds, make sure to choose a lightweight, mobile-responsive, and AMP-ready theme with optimized code that is compatible with all major browsers. Before selecting a theme, create a demo site without additional content and use PageSpeed Insights to test its loading speed.
  6. Optimize images. Images contribute to a large chunk of a web page’s size. To make sure your images look excellent while prioritizing site performance, make sure that the size of each is under 500 KB, use a suitable file format, resize them properly before uploading, and enable lazy loading.
  7. Update WordPress core, plugins, and themes regularly. Each WordPress update comes with security and performance improvements and sometimes new features. Keeping up with updates for WordPress core, plugins, and themes is essential to ensure the highest site speed. Fortunately, automatic updates can be set up quickly from the dashboard.
  8. Uninstall deactivated plugins. Make sure to delete any no longer used plugins by uninstalling them from the dashboard and deleting any leftover information such as database entries. Many developers feature comprehensive official guides on how to uninstall their plugins.
  9. Minify HTML, CSS, and JavaScript. HTML, CSS, and JavaScript files often contain many empty spaces and redundant characters to make them more readable to developers. However, this can make them slower to process by machines. You can minify your HTML, CSS, and JavaScript files using MinifyCode or the Fast Velocity Minify plugin.
  10. Use the latest PHP version. PHP 8.0 offers higher efficiency and performance, enhancing site speed. Your PHP version can be changed from your hosting account’s control panel.
  11. Optimize the WordPress database. Over time, your database will accumulate junk that can decrease WordPress site speed. To optimize WordPress your database, use the tool in phpMyAdmin or a plugin like WP-DB Manager.

We hope this guide has helped you apply the best practices to speed up your WordPress site. If you have any questions or additional tips, feel free to leave them in the comments section.

Author
The author

Domantas G.

Domantas leads the content and SEO teams forward with fresh ideas and out of the box approaches. Armed with extensive SEO and marketing knowledge, he aims to spread the word of Hostinger to every corner of the world. During his free time, Domantas likes to hone his web development skills and travel to exotic places.

Author
The Co-author

Mantas Petrauskas

Mantas is a software developer at the Hostinger Web Hosting team who mostly works with WordPress Integrations in the hPanel. When he's not working, he likes to improve his software development skills, go on road trips, play video games, and go wakeboarding.