WordPress Speed & Performance Optimization
- March 18, 2020
- Adnan Sattar
Website speed is an actual Google ranking factor. That’s why you need to emphasize site speed and performance. Unfortunately, there’s no easy solution to slow web speeds. There is no magic plugin, script, or tactic that will instantly speed up your website. Optimizing a WordPress site’s performance can be a daunting task, especially for larger sites.
Here are a few common WordPress speed optimization myths that I would like to dispel.
- Benchmarking Tools -Test Your Speed
- Choose a Better Web Hosting Provider
- Use Content Delivery Network (CDN)
- Minimizing Plugins
- Reduce Image Sizes
- Enable GZIP Compression
- Cleanup WordPress Database
- Keep External Scripts Minimum
- Disable Pingbacks & Trackbacks
- Social Media Sharing
- Async Loading
- Optimize Your Mobile Site
The major factor that influences the speed of a website is the hosting. It might seem like a good idea to host your new website on a shared hosting provider that offers “unlimited” bandwidth, space, emails, domains and more. Shared hosting tends to deliver a poorer performance in peak traffic hours because you are sharing the same server space with countless other websites, and there is no telling how much resources others are using.
In the present times, you can buy dedicated cloud servers from.
WordPress Install Guide
When dealing with very high traffic situations it may be necessary to employ multiple servers. The WordPress database can be easily moved to a different server and only requires a small change to the config file. Likewise, images and other static files can be moved to alternative servers.
Amazon’s Elastic Load Balancer can help spread traffic across multiple web servers but requires a higher level of expertise. If you’re employing multiple database servers, the HyperDB class provides a drop-in replacement for the standard WPDB class, and can handle multiple database servers in both replicated and partitioned structures.
The first and easiest way to improve WordPress performance is by looking at the plugins. Deactivate and delete any unnecessary plugins. Try selectively disabling plugins to measure server performance. Keeping unwanted plugins on your WordPress websites will add a tremendous amount of junk to your web files.
- IFTTT or Zapier are two web services that help in automating such tasks and reduce the burden on your website and server resources.
- P3Profiler is a plugin that will give you details about which plugins are slowing your site down.
Plugins like W3 Total Cache or WP Super Cache can be easily installed and will cache your WordPress posts and pages as static files. These static files are then served to users, reducing the processing load on the server. This can improve performance several hundred times over for fairly static pages.
- Page Caching: W3TC helps to decrease response time by creating static HTML versions of pages, allowing web servers to serve them without invoking PHP.
- Database Caching: Database queries (objects) are also cached, allowing many sites to reduce the time needed to generate new pages. This is especially useful for sites that receive a lot of comments.
- Headers: W3TC manages the headers (entity tag, cache-control, expires) which control the caching of files in web browsers, reducing server load and improving the user’s perceived performance.
Web server caching is more complex but is used in very high traffic sites. The simplest solutions start with the server caching locally while more complex and involved systems may use multiple caching servers (also known as reverse proxy servers) “in front” of web servers where the WordPress application is actually running. Adding an opcode cache like Alternative PHP Cache (APC) to your server will improve PHP’s performance by many times.
Varnish Cache works in concert with W3 Total Cache to store pre-built pages in memory and serve them quickly without requiring execution of the Apache, PHP, WordPress stack.
As described within, using a plugin for comments such as Disqus instead of native WordPress comments can assist Varnish by not requiring your readers to login to WordPress and increasing the number of page views that Varnish can serve out of the cache.
Images are the major contributors to size increment of a given webpage. The trick is to reduce the size of the images without compromising on the quality. 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 abovementioned plugins on your WordPress site will drastically reduce image sizes, thus improving the speed of your website.
Tips to speed up image issues:
- Instead of using Gravatar or the default silhouette, set the avatars to “blank.”
- Style your header and footer with CSS rounded corners instead of a large image.
- Use a slideshow to split your images up on different pages
- Decrease image size by more than 50% by optimizing your images.
- Lazy load speeds up your site by only loading the images that are visible, as the reader scrolls down the images will load.
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.
You can use either a plugin like the PageSpeed Ninja, which enables GZIP compression, or add the following codes in your .htaccess file.
Deleting unwanted data from your database will keep its size to a minimum and also helps in reducing 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 as well as themes. All of this will reduce the size of your databases and web files, and thus speed up WordPress – your WordPress.
The WP Optimize plugin can help you reduce extra clutter in your database.
Your database houses everything about your WordPress site, from spam comments to old plugin tables. Optimizing your database is a relatively easy way to speed up your website, here are a few ways to get started.
Pingbacks and trackbacks are two core WordPress components that alert you whenever your blog or page receives a link. It might sound useful, but you also have things such as Google Webmaster Tools and other services to check the links of your website.
Keeping pingbacks and trackbacks on can also put an undesirable amount of strain on your server resources. This is so because whenever anyone tries to link up to your site, it generates requests from WordPress back and forth. This functionality is also widely abused when targeting a website with DDoS attacks.
You can turn it all off in WP-Admin → Settings → Discussion. Just deselect “Allow link notifications from other blogs (pingbacks and trackbacks).” This will help you speed up WordPress some more.
If you can’t do without the social share buttons, consider using a plugin:
- Floating Social Bar
- Share Center Pro
- WP MashSocial Widget
- Ultimate Social Media-icons
Instead of loading all of the items at once, asynchronous loading waits for one item to load before starting the next one.
- Lazy Widget Loader
Speed is important for mobile users; most don’t have large enough data plans to sit and wait for your page and all its contents to load. You have a couple of options when it comes to your mobile site. You can choose a WordPress theme that comes with a mobile option, or use a plugin like
Optimizing a website can be a difficult subject, whether you’re a developer or not. You will find a lot of published guides and online tutorials. Keep in mind the fact that most of them are written for a broad audience scope. They might not help much in improving your specific situation.