Speed Up WordPress Performance

Updated: September 12,2017

Most studies show that web surfers are very impatient and leave a site if it has not loaded in 4 seconds, or even less. We are in an era where everything has to be fast and users just don’t want to sit in front of their computer waiting for a page to load. This is particularly true for users of mobile devices.

WordPress is a great software that can help you build beautiful websites or blogs easily without having to pay high fees for a web developer. The problem with WordPress is that it can become very slow due to many factors. A fresh WordPress installation using one of the default theme and a minimum of plugins can load very fast and get good Google Page Speed and Yahoo! YSlow scores.

This is an example of a simple blog using the default WordPress theme.

Unfortunately, 99% of the time we use fancy themes, lots of images and widgets that add heavy codes on our pages, at the wrong place, which considerably slow down our WordPress installation. There are also default WordPress settings that do not help to save server resources.

Have you Checked the Load Time of your Home Page?

If you are reading this guide there is a good chance that you have seen by yourself that there is a speed problem with your blog and if you haven’t, I congratulate you for being proactive. If you don’t see any speed issue, that does not mean that there isn’t. People with slower connections than yours or located in different countries may have issues viewing your blog. The first time you check your Google Page and Yahoo! YSlow speed you will be shocked and helpless on what to do. I certainly was the first time and spent lots of time on other blogs and forums to find solutions, and try different combinations of plugins.

You don’t have to, this guide will show you what you need to do in easy steps. If you only use a couple of optimization Technics you will see an improvement, if you use them all, you will see near perfection.

Very few bloggers take speed optimization seriously, most of them just don’t think about it, before it causes serious problems. That’s understandable, bloggers are writers and most of the time nontechnical. I, myself, waited that my hosting bill got bigger before I took an interest. Slow speed is a sign that your blog is using too much CPU power and RAM from your server and your hosting company will be happy to offer you to buy an upgrade. They may kick you out, even if you have a package where everything is unlimited, if you are causing too much CPU trouble. Applying what you learn in this guide will save you the extra cost of an upgrade.

What Can a Website Speed Test Help You Analyze?

Here are just a few of the common ways websites speed test tools are used:

  • Pinpointing scripts, fonts, and plugins causing load time issues (HTML, Javascript, CSS)
  • Checking minification of your scripts
  • Finding large images resulting in bottlenecks
  • Determining if you have render-blocking JavaScript or CSS
  • Testing Time to First Byte (TTFB)
  • Analyzing total load times, page sizes, and # of requests
  • Checking performance from different geographical locations
  • Checking rendering speed in different browsers
  • Analyzing HTTP Headers
  • Measuring performance of your Content Delivery Network
  • Verifying that assets are loading correctly from your CDN

Optimizing your blog for speed is not only a good thing for your user experience, but also good for your ranking. Load speed is one of the factor used by the Google algorithm to decide if your site should be ranked higher than another. If your site is slow to load, your ranking suffers and this is a good reason to speed up your WordPress blog today!

List of Website Speed Test Tools

Page load speed is a significant factor to measure the performance standard of a website. If your site loading speed is only a few seconds slower than your competitor’s sites, you may find lots of differences in the result. Thus, while you do not like to lose your revenues, you have to know the accurate speed of your website loading. To make this task simple, you may use some online tools.

However, an only one-speed test does not give the best-optimized result. That is why you need to do these tests at various times of a day. The most useful trick is to carry out the tests on almost every hour. Remember that the performance of any website changes all over a day. On the basis of the number of visitors to your site and the use of a server, the performance may vary. With the help of these tests, you may also find the particular hours, when you get maximum website visitors. And at this time, you can post fresh content and advertisements to convince the visitors. 5 to 10 tests help you in learning lots of things.
Now, we have reviewed some tools and effective techniques to increase website loading speed.

GTmetrix

Speed Up WordPress Performance - image GTmetrix-Performance-Report-A100-A100 on https://trunk.ly

This is one of the free tools, allowing you to know whether the visitors can load your website smoothly. The tool also gives recommendations about the optimization of pages. It analyzes the web site loading process from a variety of locations in this world to inform the experience of all the users. With GTmetrix, you may also assess the performance of websites against various types of connections, such as dial-up or cable. The option for web page loading video also helps you to detect the issues. Slow down the playback to have a comprehensible view of page load.

Pingdom

Speed Up WordPress Performance - image Pingdom-Tools on https://trunk.ly

Assess your web page loading speed and monitor its uptime with the use of Pingdom. You will be able to make out whether your website’s speed is slow or fast. You can also learn the techniques that enable you in speeding up your site loading process. The simple tool assists you to look into every part, related to the page. For instance, you can evaluate the size of files and many other details of each web page. Save the results of every test that you have conducted for your website.

The report also presents everything depending on the domain requests and content style.
One of the unique features of this tool is that it helps you in testing the speed of website from a range of locations, such as Dallas, Stockholm, San Jose, and Melbourne.

WebPagetest

It is another free tool, displaying the web page loading time and six different grades of performance. You can find an option- Page Speed, and after selecting it, you can get not only the grade but also the recommended changes to increase the load speed of your site. WebPagetest also gives you an opportunity to choose a country or region (more than forty locations), from where you should run the test. In fact, it is useful for tracking speeds at any place. After the tool has accomplished performance analysis, it shows you a report on compression, FTTB, caching, CDN usage and much more. Other sophisticated features, available with this tool, are Javascript disabling, video tracking and so on.

Before you start optimizing the performance of your blog, record your current data, including page-loading times, using the services described below. This will help you compare your results to a baseline and determine how effective the performance tweaks really are.

Choose a Reliable Web Host

Speed Up WordPress Performance - image hosting-featured-image on https://trunk.ly

Nowadays, lots of business people and bloggers build their websites on WordPress platform. And so, they are trying to run their WordPress site at the fastest speed. WordPress website hosting enables you in organizing and in developing the content quickly. A slow web host delays your page loading time. The fastest site hosting gives comfort to the visitors while accessing your platform.

The most significant way for enhancing your WordPress website speed is to create an effective base. In many sites, you can see the Bluehost web hosting ads. However, most of them are affiliate marketing websites, where the only intention is to earn money by promoting Bluehost. However, the truth is that Bluehost does not provide high-quality hosting service. If you want to stay free of concern about your website’s downtime, we can recommend you some superior solutions.

With affordable and shared web hosting solutions, SiteGround has become much popular. SSD, PHP7, HTTP and several other attractive features are available to the users. The cheapest package offers you considerable disk space (10GB), free website domain and everyday backup. As this web host supports PHP7, your site can run faster. Display the plugin for looking at the current version. Some web hosts, like Godaddy, do not consider PHP7. However, you can find it with SiteGround.

The exclusive technologies of SiteGround, allowing you to have fastest load speed

  • SSD – They are faster, in compared to ordinary drives. As one of the SiteGround clients, you may use SSD for your website.
  • Nginx – This is another technology for boosting up the page loading rate when your site has static web content.
  • SuperCacher – It is a unique website caching system to load dynamic web content.

If you’re still using PHP 5 or MySQL, you have a poor server stack. Top of the range looks something like this – you can speak to your current hosts and ask them if they can provide it:

  • Nginx instead of Apache
  • Redis or Memcached instead of no memory-based caching engine (or instead of disk caching)
  • PerconaDB or MariaDB instead of MySQL
  • Varnish or Nginx fast cache instead of no micro-caching or short-term page-caching solution
  • SSD instead of HDD
  • PHP 7 instead of PHP 5
  • Fail2ban – this beats WordFence on performance and security, no question. It solves security at the firewall level meaning any bots attacking your site consume ZERO resources on your server
  • Letsencrypt SSL – Google cares about HTTPS these days and is starting to warn users that non-HTTPS sites are insecure. If you have users logging in, you MUST use HTTPS. Letsencrypt gives you free SSL certificates for life.

Use SSL and Utilize Http/2

SSL protects your visitors and customers by encrypting all the information travelling between browser and server, ensuring extra security for your users and their data. It is essential for eCommerce sites and those handling sensitive data, and strongly recommended for all websites following recent developments on the web.

Previously, SSL certification was believed to slow down your website. Not any more! If you have a server that supports HTTP/2, and a working SSL certificate, your traffic will be going through HTTP/2.

Speed Up WordPress Performance - image HTTP2 on https://trunk.ly

The HTTP/2 protocol is much faster and allows the browser to make multiple simultaneous requests for resources to the server, which results in faster and safer sites. If you’re worried about the cost of an SSL certificate, there is a free solution called Let’s Encrypt. With it you can maintain the security of your websites without compromising on speed.

Use a Solid Framework/Theme (Use a Lightweight Theme)

When you are developing your WordPress site, you want to choose a relevant theme. However, for each of the themes, there are diverse codes, and that’s why all of them are not same. The default ones are not only lightweight but also run very fast. You may look at WordPress theme collection or choose a premium website them from a recognized company. You can better make a thorough study of WordPress themes so that you will be able to invest money considerately in future. You may go through the theme reviews. It is better to avoid those providers, who don’t give instant response to you.

Try to pick only the well-coded theme as the coding quality affects your website performance to a significant level. Many of the advanced themes include the plugin systems with some more extra features. However, this kind of functionality may cause your page to load very slowly. And it happens due to the structure of MySQL database queries. There is no need to become a well-skilled developer for creating the website. The only thing, which you must ensure, is that the codes are written well.

While you are researching on themes, you may find many providers, claiming that their themes are compatible with almost all websites. Such themes also have several features, including carousels and sliders. And most of them are backed up by CSS and JavaScript. But, if these resources are not useful to you, they can become simply useless.
Thus, the best decision that you can make is to choose a theme with only major functionality.

I use MyThemeShop on a lot of my websites and couldn’t be happier. I saw a 250ms decrease simply by changing themes, without anything else! Kudos to the team over at MyThemeShop because they know how to code properly, keep things lightweight, and still include schema markup and rich snippets, which are things most competitors don’t.

Content Delivery Network (CDN)

You have perhaps already chosen the fastest website hosting company. However, it is not easy to solve the issue of latency. Only a Content Delivery Network is the best solution in this case. Regardless of the content type, there are CDNs in each text. CDN helps in storing all the asset copies, including CSS, Javascript, and images. Rather than the online server, the delivery of content takes place from POP.
CDN puts the content in a variety of sites instantly, allowing the users to have good coverage.

Speed Up WordPress Performance - image cdn-explained on https://trunk.ly

However, remember that CDN is not good for all. While you have made your website targeted at only local regions, you may not get much benefit from CDN. In such case, the use of CDN may deteriorate the performance of site with the introduction of lots of connection spots. However, still, lots of website owners have chosen CDN as their major option. In most of the cases, websites, related to e-commerce, gaming, mobile and advertisement, use CDNs.

Use this plugin, if you are one of the WordPress site users. This plugin is not only lightweight but also integrates quickly into the website. The plugin is designed in such a way that it allows you to comprise directories. You may also skip any extension or activate some paths. With the help of this plugin, you can use CDN effortlessly.

Process for installing CDN plugin

In the dashboard of WordPress account, you may find the option – Plugins -. And under this menu, you can get another option – Add New -. After clicking on it, you can browse the plugin – CDN Enabler -. You have to hit the Install button and then Press Activate button to start the action of a plugin.

Go to the Settings menu of the dashboard and find CDN Enabler. Put in the URL, activating the HTTPS option. However, you should ensure whether the CDN runs with HTTPS. While the URL is not known to you, it is better to look for professional assistance.
So, if you want to increase your web page loading speed, you may use the above guide. Choose the best-quality, reliable tools, and assets that allow you to beat all your competitors.

I use KeyCDN of course for all of my websites. Now yes I work for them so I might be a little biased. But at $0.04/GB (lowest price globally) with more POPs than MaxCDN, there really is no comparison and it’s a no brainer. KeyCDN also offers origin shield and secure token free of charge which most other providers charge hundreds of dollars for. KeyCDN also has a free Let’s Encrypt integration so you can deploy SSL for free. And they fully support HTTP/2 and the latest protocols so that your content is delivered as fast as possible.

Please backup your WordPress before starting this process. Moreover, I highly encourage you to back up your site during the process as well, so you can get back to a working state if anything should go wrong.

Utilize Caching

There are several different plugins available when it comes to implementing a cache system. The one you select will depend on the capabilities of your server (Shared Hosting vs. Virtual Private Server / Dedicated Server), your level of expertise, and your personal preference.

Caching is a very important step to speed-up your WordPress blog. If your blog is new and you just have few visitors, you may not need to cache it. Later down the road and if your blog becomes successful, this is something you will have to do.

Normally, each time a visitor reaches a page on your blog, it has to be rendered with PHP and My SQL. It is done very easily, but when you have a dozen visitors accessing at the same time, the server uses more CPU and RAM and it slows down your blog. When you get 3 dozen visitors accessing a page at the same time, it can become critical, even crash the server or display an error page, especially if you are on a basic share hosting package.

The solution is to change your dynamic WordPress pages by static HTML pages. This is done with the help of caching plugins. This means that an HTML page will be accessed by your visitors instead of the original PHP page. The PHP parser and the MySQL database won’t be needed and the page will load fast, even with a hundred visitors to your site in any given time.

The easiest way to cache your site is through a plugin.  WP Rocket is a great premium option, or if that’s outside your budget, try WP Super Cache.

Go to your plugin section and look for:“WP Fastest Cache”.

Speed Up WordPress Performance - image wp-fastest-cache on https://trunk.ly

317,945 users are using this excellent plugin. Click on the“Install Now” button and activate “WP Fastest Cache”. In the menu, you will see an entry for the cache plugin.

In the menu, you will see an entry for the cache plugin. Click on the link to access the plugin’s page and set the options below.

Speed Up WordPress Performance - image WP-Fastest-Cache-Settings on https://trunk.lyLet’s have a look at the settings:

  • Cache System:Enable(Checked)
  • Logged-in Users:Don’t show the cached version for logged-in users. (Checked)

If you are the only admin of the blog, it is better to have this checked so when you update your blog, you can actually see your updates and not a cache version. If you have multiple authors or contributors that have to be logged-in, it might be worth to show the cache version, and uncheck this option.

  • Mobile:Don’t show the cached version for desktop to mobile devices.(Checked)

This is an option when unchecked that you will want to test on a mobile device. Depending on your theme, showing the cache version may be a disaster or work just fine.

  • New Post: Clear all cache files when a post or page is published. (Checked)

When a post is published, things change on multiple pages like the“last posts” section in your blog’s sidebar, so it’s better to have the cache cleared. When setting the plugin for the first time, I advise you not to check the options: Minify HTML, Minify CSS, Combine CSS and Combine JS.

The reason for this is that this is already being done by the “Autoptimize” plugin.

  • Gzip: Reduce the size of files sent from your server. This will increase the speed to which the files related to your page are transferred to the user’s browser.
  • Browser Caching: Reduce page load times for repeat visitors. Commonly used files from your website are stored on your visitor’s browser so they do not have to load every time. Click the“Submit” blue button to save your settings.

How to Check if Fastest Cache is Working

If you have selected the option not to show the cache page to logged-in users, you have then to log yourself out. Then go to your Front Page and refresh twice. If you’re using Chrome browser, in the URL bar, write: view-source:http://yourdomain.com , scroll down to the end and you will see

</html><!-- WP Fastest Cache file was created in 0.47094488143921 seconds, on 07-05-17 11:54:55 --><!-- need to refresh to see cached version -->

WordPress Caching Plugins

  • WP Fastest Cache – This plugin creates static html files from your dynamic WordPress blog.
  • WP Super Cache – This plugin generates static html files from your dynamic WordPress blog. After a html file is generated your webserver will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP scripts.
  • Comet Cache – If you care about the speed of your site, Comet Cache is one of those plugins that you absolutely MUST have installed Comet Cache takes a real-time snapshot (building a cache) of every Page, Post, Category, Link, etc.
  • Cache Enabler – The Cache Enabler plugin creates static HTML files and stores them on the servers disk.
  • Simple Cache – Simple Cache was constructed after getting frustrated with the major caching plugins available and building sites with developer-only complex caching solutions that get millions of page views per day.
  • Gator Cache – Gator Cache is an easy to manage page cache for WordPress. Once installed, it automatically updates new and updated content in your cache.
  • Vendi Cache – Vendi Cache takes your slow database-driven pages and turns them into very fast static HTML files.
  • SG Optimizer – This plugin is designed to link WordPress with the SiteGround Performance services.
  • WP Rocket – Your website at lightspeed.
  • W3 Total Cache Fixed – A community driven build of W3 Total Cache. The aim is to continuously incorporate fixes, improvements, and enhancements over the official WordPress release of W3 Total Cache.
  • WP-FFPC – WP-FFPC is a cache plugin for WordPress.
  • Cachify – Cachify optimizes your page loads by caching posts, pages and custom post types as static content.
  • Batcache – Batcache uses Memcached to store and serve rendered pages.
  • Hyper Cache – Hyper Cache is a cache plugin specifically written to get the maximum speed for your WordPress site.
  • Powered Cache – Comprehensive caching and performance plugin for WordPress.
  • WP Spider Cache – WP Spider Cache is your friendly neighborhood caching solution for WordPress. It uses Memcached to store both objects & page output.
  • Redis Page Cache for WordPress – A Redis-backed full page caching plugin for WordPress, extremely flexible and fast. Requires a running Redis server and the PHP Redis PECL extension.
  • Varnish Caching – Complete WordPress Varnish Cache 3.x/4.x integration.
  • WordPress Cache and CDN – Fast, easy to use cache for WordPress with option for up-to 3 separate CDN’s – for js, css & images from 3 providers.
  • Breeze – Breeze is a WordPress cache plugin with extensive options to speed up your website. All the options including Varnish Cache are compatible with Cloudways hosting.
  • Varnish Caching – WordPress Varnish Cache integration.
  • Pantheon Advanced Page Cache – Automatically clear related pages from Pantheon’s Edge when you update content. High TTL. Fresh content. Visitors never wait.

Optimizing Your Images

Speed Up WordPress Performance - image Optimizing-Images-wordpress on https://trunk.lyImage optimization is very important to speed up your blog. The images on your blog are certainly too big for desktop and mobile displays. Even if you have carefully saved your images for the web using Photoshop, Gimp, Acorn or other image software, you will be surprised to see how much kilobytes you still can save with the method I am about to show you. Hopefully, you do not have to optimize each image individually again. This would be a daunting work especially if you already have thousands of images in your blog.

You need a solution that can optimize your existing images in your Media Library, but also any new image you upload automatically. How does that sound? The solution is to use a plugin called “EWWW Image Optimizer”.

EWWW Image Optimizer

There are several plugins that do the same thing, but EWWW is excellent in what it does.

The benefits of using EWWW Image Optimizer are:

  • Your pages will load faster because smaller image sizes means faster page loads.
  • Your backups will be faster.
  • You will use less bandwidth.
  • You can optimize hundreds of images in just a few minutes.
  • You can optimize any image in WordPress including those that are not in theMedia Library like theme images.

Now, you may have some concerns about how your images are going to be manipulated. Are they going to look as good as the originals after optimization?

By default, EWWW Image Optimizer uses lossless optimization techniques, so your image quality will be exactly the same before and after the optimization. The only thing that will change is your file size. — Your images will look the same.

Install EWWW Image Optimizer

Go to your“Add plugin”section and search for EWWW Image Optimizer. The plugin will show.

Speed Up WordPress Performance - image ewww-image-optimizer-plugin on https://trunk.ly

As you can see this is a very popular plugin with 500,000+ downloads, compatible with the latest WordPress version and updated frequently. Click on the“Install Now” button to install the plugin and activate it.  Then go to the“Settings”menu and click on EWWW Image Optimizer.

Speed Up WordPress Performance - image EWWW-Image-Optimizer-settings on https://trunk.lyIn order for the plugin to work you need to have jpegtran, optipng, pngout and gifsicle installed on your Linux server. If your plugin status is not“All Clear” and you have one of these missing you need to contact your web server company to ask them to install them for you. If problems persists contact the plugin developer.

Let’s have a look at the“Basic Settings”.

Speed Up WordPress Performance - image EWWW-Image-Optimizer-basic on https://trunk.ly

The only two things you need to do is check the“Remove metadata”and enter a“Bulk Delay” that will work for your server. If you are on a share server you may want to be more patient and select 5, 6 or 10 seconds; if you are on a VPS or dedicated server, a pause of 3 seconds between images should be enough.

Ignore“Cloud Settings”, “Advanced Settings” and “Conversion Settings” as leaving them with their default settings will satisfy most users.

Optimize your Images From the Media Library

There are two ways to optimize your existing images. The first way is to go to your “Media Library” and optimize each image one by one. Click on“Library”. Notice that a new section for “Image Optimizer” has been added to your Media Library. In the screen shot above it shows that the original images were not processed and indicates each image’s size. Let’s click on the “Optimize now!” links and see what happens.

Speed Up WordPress Performance - image optimize-media-wordpress on https://trunk.ly

As you can see the images have been reduced by 2.1% , which is a saving of 42.7 kB. Can you imagine how much space will be saved when optimizing the x,XXX images on the blog? The “Re-optimize” link and conversion link “PNG to JPG” can be used in certain occasion, but I prefer not to use them at all and you don’t need to. Another way to optimize images from the Media Library is to select the images you want and select the“Bulk Optimize”option and click “Apply”.

Bulk Optimize your Images

You imagine that optimizing x,XXX images from the Media Library is not the ideal way to do it. Hopefully, EWWW Image Optimizer has a Bulk Optimize feature. From the Media menu, select “Bulk Optimize”. You will see the “Bulk Optimize” page. Enter the pause duration between images and click “Start optimizing”. The optimization starts right away. Each image you have in your Media Library has copies of itself in different sizes and they are all optimized when needed.

Speed Up WordPress Performance - image optimize-images- on https://trunk.ly

You can see in the image above that previously optimized images are not re-optimized. When you scroll down the page you can see the status of all images as they are optimized.

  • Some of the images are reduced and some are not. Small images are most of the time not reduced because there is nothing to optimize.
  • You can see the progress of your optimization and can stop the process at any time in clicking the “Stop Optimizing” button.

On the same“Bulk Optimize”page, locate this area and click “Scan and optimize”.

Speed Up WordPress Performance - image ewww-bulk-optimize on https://trunk.ly

This will look for other images that are not in the Media Library, specifically your Theme images.

Now all your images are optimized. The images on all your posts and pages of your blog, not only the Front Page will load faster.

Image Optimization Plugins

  • EWWW Image Optimizer – The EWWW Image Optimizer is a WordPress plugin that will automatically optimize your images as you upload them to your blog.
  • EWWW Image Optimizer Cloud – The EWWW Image Optimizer is a WordPress plugin that will automatically optimize your images as you upload them to your blog.
  • TinyPNG – Make your website faster by optimizing your JPEG and PNG images. This plugin automatically optimizes all your images by integrating with the popular image compression services TinyJPG and TinyPNG.
  • Imagify – Speed up your website with lighter images without losing quality.
  • ImageRecycle – ImageRecycle is an automatic Image and PDF content optimizer for WordPress website.
  • ShortPixel Image Optimizer – Increase your website’s SEO ranking, number of visitors and ultimately your sales by optimizing any image or PDF document on your website.
  • Kraken.io – This plugin allows you to optimize and resize new and existing WordPress image uploads through Kraken.io Image Optimizer’s API.
  • Optimus – Optimus reduces the file size of uploaded media files automatically. Depending on the image and format, reductions in size of up to 70% are possible.
  • WP ImageEngine Responsive Image Resizer – WP ImageEngine is an intelligent image CDN for optimizing, compressing and resizing images.
  • Image Compression and optimization – Optimize your Images as well as Image Compression of upto 80%. Also resize images on upload to help reduce storage and bandwidth before compressing.
  • Media Cleaner – Clean your Media Library from the media which aren’t used in any of your posts, gallery and so on.
  • ImageLint – One-stop hassle-free no-config ImageLint WordPress integration.
  • FAF Optim – Optimize images of your WordPress media storage.
  • Media Deduper – Save disk space and bring some order to the chaos of your media library by removing and preventing duplicate files.
  • WP Smush – Reduce image file sizes, improve performance and boost your SEO using the free WordPress Smush API.
  • JPG, PNG Compression and Optimization – WP Image Compression is a quick and easy way to not only resize your images, but compress them as well for optimimum performance going forward.
  • Resizefly – Dynamically resize your images on the fly

Be Aware when Adding Too Many Images

Too many images on any given web page can drastically increase the page size/ number of requests. Consider deleting unnecessary images or at least making sure you optimize any images before uploading them to your blog.

Serve Scaled Images // Specify Image Dimensions

  1. Whenever you add an image using HTML, you want to make sure you add its dimensions. Otherwise, your browser will not be able to tell the size of the image and will need to reflow the page after downloading that resource. This will affect performance.
  2. When adding images through the Media Upload feature inside WordPress, you will not have to worry about this.
  3. However, if you are uploading and inserting images manually please consider this. Even if the image is used for tracking purposes (e.g. Piwik), in some cases you can add dimension attributes (e.g. “1”)
  4.  Your WordPress Theme may have failed to include these attributes
  5. Using Notepad ++, go to Find in Files and search all “< img” appearances inside the folder of your theme
  6. Revise all insertions to make sure the images include these attributes
  7. Given the case, find the image and determine its dimensions. Append the necessary attributes to the code of your theme.
  8. Save your modified files and upload them to your server, overwriting the old ones.

Specify Image Dimensions is a plugin that scans and inserts missing width and height in all <img> tags. Specifying the dimension allows for faster rendering by eliminating the need for unnecessary re-flows and repaints.

 

Use the Best File Formats

Before uploading images, make sure you save them as optimized file formats.

The best formats to choose from are: PNG 8/ 24 bits, JPEG, GIF (when the image is really small) Illustrations and graphics with less colors work great with PNG 8 bits. Photos and images that contain more colors should usually be saved as JPEG (determine the JPEG quality by using an Image Editing software like Paint.NET).

There are image-optimizing softwares available for you to use. Consider:

Reduce Misc HTTP Requests

Turn Off Default Gravatar Images

Using default Gravatar avatars such as: whenever a user that does not have a custom avatar posts a comment is not very useful. It will increase the amount of images and therefore the size of your page. It will also add to the amount of server requests which will additionally worsen the load time of your page.

Go to your WordPress Admin Panel, under Settings – Discussion. If you don’t want to use avatars at all, deactivate the display of gravatars. If you want to use avatars, I highly suggest selecting the option “no avatar” under Default Avatar.

Disable Emojis

With the release of WordPress 4.2 came updates for additional emoji support. Unfortunately what this means is that they are now including an additional javascript file wp-emoji-release.min.js?ver=4.3.1 in your header. This creates an unnecessary additional HTTP request, especially if you don’t want to even use them.

Follow the instructions below to disable emoji’s and get rid of that additional HTTP request.

First under “Writing Settings” in WordPress make sure you uncheck the “convert emoticons” option under formatting. Then follow the rest of the steps below.

Option 1 – WordPress Plugin

Install the free WordPress plugin “Disable Emojis” by Ryan Hellyer. This plugin disables the new emoji functionality in WordPress 4.2.

Option 2 – WordPress Function

If you don’t want the overhead of another plugin then simply take the code from Ryan’s plugin and drop it into the bottom of your functions.php file.

/**
 * Disable the emoji's
 */
function disable_emojis() {
 remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
 remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
 remove_action( 'wp_print_styles', 'print_emoji_styles' );
 remove_action( 'admin_print_styles', 'print_emoji_styles' ); 
 remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
 remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); 
 remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
 add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
}
add_action( 'init', 'disable_emojis' );

/**
 * Filter function used to remove the tinymce emoji plugin.
 * 
 * @param array $plugins 
 * @return array Difference betwen the two arrays
 */
function disable_emojis_tinymce( $plugins ) {
 if ( is_array( $plugins ) ) {
 return array_diff( $plugins, array( 'wpemoji' ) );
 } else {
 return array();
 }
}

Disable Embeds

Since WordPress 4.4, there is a new script that is loaded, wp-embed.min.js which allows you to more easily embed videos, images, tweets, etc. For example, WordPress will automatically turn the URL into a YouTube embed and provide a live preview in the visual editor. A lot of people don’t use this feature or might not need it. You can always link the original way by grabbing the embed code off of YouTube or Twitter. The big issue with this feature is that is loads the script on every page. There are a couple ways to disable this script.

Option 1 – WordPress Plugin

Install the free WordPress plugin “Disable Embeds” by Pascal Birchler. This plugin does the following:

  • Prevents others from embedding your site.
  • Prevents you from embedding other non-whitelisted sites.
  • Disables all JavaScript related to the feature.

Option 2 – WordPress Function

Or you can drop the following into the bottom of your functions.php file to also disable embeds.

// Remove WP embed script
function speed_stop_loading_wp_embed() {
if (!is_admin()) {
wp_deregister_script('wp-embed');
}
}
add_action('init', 'speed_stop_loading_wp_embed');

Disable Comments

Whenever you are using threaded comments in WordPress the comment-reply.min.js script is included on every post and page. There might be times when you don’t need this script. Maybe you don’t allow comments on your site or you use a 3rd party commenting system like Disqus. In those cases there is no need for this script to load on every page.

To disable this script you can drop the following code into the bottom of your functions.php file.

// Remove comment-reply.min.js from footer
function comments_clean_header_hook(){
 wp_deregister_script( 'comment-reply' );
 }
add_action('init','comments_clean_header_hook');

Disable Hotlinking

Hotlinking refers to someone directly linking to one of your images on their own server. What this means is that when someone visits their site it has to load the image from your server, taking up your bandwidth. You can disable hotlinking by adding the following code to your .htaccess file and updating it with your domain name.

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

Turn Off Pingbacks and Trackbacks

Even though this step is entirely optional, deactivating the use of pingbacks and trackbacks can improve your site’s performance: server load will be decreased.

Go to your WordPress Admin Panel, under Settings – Discussion . Under default article settings, deactivate: “Allow link notifications from other blogs (pingbacks and trackbacks)” and/ or “Attempt to notify any blogs linked to from the article”

Reduce the Usage of External Fonts

Each font that you use from Google Free Fonts or another similar service has multiple variations, weight (300, 400, 500, 700), encoding (Latin, Cyrillic), style and so on. Check your website and include only the font variation that you’re actually using. Furthermore, if you’re loading a font for a small piece of text somewhere on your site, I recommend compromising on the design and simply using a font you already have on other pages.

Enable Gzip Compression For Your Pages

With gZIP compression enabled, the final HTML output of your site and some of the static resources will be compressed before being transmitted to your visitor. Then, your visitor’s browser decompresses the content before rendering. It’s much faster to compress and decompress this content than to transfer it without compression. Enabling gZIP compression is very easy and requires almost no effort. Simply add this code to the .htaccess file in your WordPress main folder:

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

Remove Query Strings

The first way to remove query strings is you can put the following code into your functions.phpfile.

function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );

If you prefer to use a free lightweight plugin, Atul Kumar Pandey has created a great “Query Strings Remover” plugin for WordPress. The total size of the plugin is only 1.5 KB.

Avoid Text Images

Adding images that only contain text is not a good practice. In terms of performance, browsers will have to download additional images; the number of requests will increase. In terms of SEO, Search Engines cannot read images. Changing images for text could improve your On Page SEO (use H1, H2,… for example) Change any text images (or even logos) for CSS Stylized text instead.

Go to http://www.w3schools.com/css/css_text.asp if you want to know more about creating CSS Styles. You can also use Google’s web font library to include more creative fonts in your blogs. Read more about that here: http://www.google.com/webfonts

Fix The admin-ajax.php Slow Problem

In WordPress 3.6 the WordPress Heartbeat API was introduced, which allows WordPress to communicate between the web-browser and the server. This improved upon session management, revision tracking, and auto-saving.

The WordPress Heartbeat API uses admin-ajax.php to run AJAX calls from the web-browser. You have probably seen this when running speed tests. This can cause high CPU usage and a lot of PHP calls. For example, if you leave your dashboard open it will keep sending POST requests to this file on a regular interval.

There is a free WordPress plugin called heartbeat control which allows you to easily manage the frequency of the WordPress heartbeat API.

 

Database Cleanup / Optimize

Deactivate / Remove Unnecessary Plugins

If a plugin includes several functions, make sure you use most of them. Don’t install another plugin if one of your active plugins can already do the job. For example, if you’re using the Yoast SEO plugin and you want to have a Google XML Sitemap, just enable this functionality in the plugin settings page instead of adding another plugin, even though there are dozens available in the plugin repository

  • P3-Profiler You’ll be able to see which plugins consume the most memory and have the biggest impact on your server (it may cause conflicts with already installed plugins)
  • Plugin Organizer With plugin organizer you can determine which plugins should be loaded first and in which order. (it may cause conflicts with already installed plugins)

Always Keep Your Plugins Up-to-date

Most of the updates in plugins either offer security patches, new features, bug fixes, speed improvements or a combination of the above. In addition, there are new features, functions, etc. constantly being introduced with WordPress core updates. A lot of them are designed to allow plugins to operate better and faster.

By keeping your plugins updated, you will get all the performance improvements from the newest release. Keeping your plugins up-to-date will allow you to use more recent PHP versions including PHP7, which gives your site a huge performance boost.

If you’re not using a plugin, delete it. There is no need to keep them on your account. It’s good security practice and one less thing to slow down your back-end.

Reduce Spam Comments

Receiving spammy comments is usually useless and will only affect your server. Install and activate one the following plugins to fight spam:

Install These WordPress Plugins

Install the following plugins (based on your personal preference): My Suggestions:

And activate the plugins. We will use them to help us clean and optimize our blog and database.

Database optimization EASY

Your WordPress blog works with a database that contains all your blog’s information. After a time, your database becomes filled with useless entries that are not needed and slow down access to it. This can seriously affect your pages’ loading time. On a Linux server with PHP, MySQL databases are used.

Optimizing the database can be done manually through PhpMyAdmin that you can access from your Host’s Control Panel or WordPress plugins. Why Optimizing the Database? If you are like me, you rarely get a post or page right away. Each time you save a post, a revision is created, and even if you don’t save, it is auto saved for you. Let’s have a look at one of my latest post.

Speed Up WordPress Performance - image revisions on https://trunk.ly

These are useful to have when writing the post in case you want to reverse back to an earlier version, but in fact it is rarely used. There are a lot of posts on my blog and I have never reversed back to an earlier version. If the post is long with many images, you get the post in 8 more versions. That’s a huge number of kilobytes on your MySQL overhead. If you multiply 8 by 525 posts, you have 4,200 revisions sitting there in your database! Depending on how you deal with Spam comments, you might have thousands of them waiting for moderation or deletion. With the spam robots out there, you may have 3,000 spam comments cluttering your database.

Back-up your Database

Modifying the database can be potentially dangerous and before I give you the plugin to use to optimize your database, you absolutely need to know how to back-up your database. Instead of installing yet another database management plugin, I am going to show you how to do it from your Control Panel.

If you have installed your blog yourself, you should be familiar withCpanel. The first step is to log in your Cpanel and locate the“Databases” section. Click on “phpMyAdmin”.

phpMyAdmin will open in a new window. In the left margin, locate your database. If you have installed it automatically fromF antastico or another installer, you should have“wp” in the name. Click on the entry to display the database at the right. Click the“Export” tab.

Check this video tutorial

The file will download in the “Download” folder of your computer. I hope you will do this step before using the plugin I am about to show you. It’s better to be covered than sorry.

Now the fun begins! This plugin will help you get rid of the junk in your database in just a few clicks. Go to your plugin section and look for: “WP-Optimize

Speed Up WordPress Performance - image Install-WP-Optimize on https://trunk.ly

Click the“Install Now” button. Activate the plugin. Locate“WP-Optimize” in your left menu.

You will see this page.

Speed Up WordPress Performance - image WP-Optimize-Configuration on https://trunk.ly

Let’s go to the“Settings” section first. You may choose to keep 2 weeks data to be safe.

You can Disable your trackbacks and Enable your comments in this section. WordPress interacts with other blogs that have pingbacks and trackbacks. Each time another blog mentions your blog post in their own post, it notifies your blog, which updates data on the post mentioned. That’s better to have this off. In the contrary, that’s better to have all posts opened for comments. Click “Save Settings”. Now, you can set up your “Auto Clean-Up Settings” on the same page.

Optimizing the database every week seems good. Click the “Save Auto Clean-Up Settings” button.

Note: Transients options are created by WordPress automatically, so it is good to remove them on schedule as well. It is red because there is a potential danger to remove them from the database.

Let’s go now to the“Tables” tab.

Speed Up WordPress Performance - image WP-Optimize-Optimizer on https://trunk.ly

In this example there is no spam comments, no unapproved comments, no auto-draft posts, no pingbacks and no trackbacks, so it is not necessary to select these options. It might be necessary for you.

In the right column, check “Optimize database tables”. Notice the value of your current database and what can be save and click the“Process” button.

Five seconds later, your database is optimized! You can see the result of your optimization with the date of the next automatic database optimization, which is a week later. You can congratulate yourself on the data you have saved! One last thing to do is to navigate your blog to see if everything is working fine.

Database Optimization Plugins

  • WP-Sweep – WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.
  • Optimize Database after Deleting Revisions – Host your Google Analytics javascript-file (analytics.js) locally and keep it updated using wp_cron().
  • Delete Expired Transients – Delete old, expired transients from the WordPress options table (wp_options), to prevent them from bloating your database and even slowing down your website.
  • Plugins Garbage Collector – Plugins Garbage Collector scans your WordPress database and shows the tables beyond of core WordPress installation.
  • Delete Expired Transients – Delete old, expired transients from WordPress wp_options table.
  • Advanced Database Cleaner – Clean database by deleting unused data such as ‘old revisions’, ‘old drafts’, ‘orphan options’, etc. Optimize database and more.
  • Index Autoload – Adds an index to the autoload in wp_options table via WP-Cron on a daily basis, resulting in a more efficient database and faster site performance.
  • Clean Up Optimizer – Clean Up Optimizer is a Superlative High Quality WordPress Plugin which not only allows you to clean and optimize the WordPress Database but also performs other vast functions.
  • Dedicated Transients – WordPress plugin to re-route transient storage to dedicated tables.

Note: If you check the speed of your blog with GTmetrix after the image and database optimization, you may not see a significant improvement in the load time and your scores. The whole blog is now working better and you have saved space and bandwidth, which will help for the next steps.

Disable WordPress Revisions

To disable WordPress revisions you will need to add the following code to your wp-config.phpfile. This changes the default autosave interval from 60 seconds to 5 minutes and then disables post revisions. By default, there is still one autosave per post.

define('AUTOSAVE_INTERVAL', 300); // seconds
define('WP_POST_REVISIONS', false);

Avoid High CPU Plugins

Based on WordPress Speed Up Facebook Group, the following plugins use a lot of resources. It is preferable not to install them.

  • Better WordPress Google XML Sitemaps
  • Broken link checker
  • Constant Contact WordPress Widget
  • Contact Form 7 (https://contactform7.com/loading-ja…)
  • Contextual Related Posts
  • Digi Auto Links
  • Disqus Comment System
  • Divi builder
  • Essential Grid
  • Fuzzy SEO Booster
  • Google Analytics (can be speed up with Swift Performance plugin)
  • Google XML Sitemaps
  • Jetpack
  • NextGEN Gallery
  • NewStatPress
  • PHP Code for Posts
  • Reveal IDs
  • Revslider
  • S2 member
  • SEO Auto Links & Related Posts
  • Similar Posts
  • Slimstat Analytics
  • Simple Post Thumbnails
  • Skype Status
  • SumoMe
  • Tawk.to (can be speed up with Swift Performance plugin)
  • VaultPress
  • Visual Composer
  • WooCommerce
  • WordPress Facebook
  • WordPress Related Posts
  • WordPress Popular Posts
  • WP Statistics
  • WP-PostViews
  • WP Power Stats
  • wpCloaker
  • WPML
  • Yet Another Related Post Plugin
  • Yuzo Related Posts

Limit DNS Lookups to 1-5 Different Hostnames

Google Says: Before a browser can establish a network connection to a web server, it must resolve the DNS name of the web server to an IP address. Since DNS resolutions can be cached by the client’s browser and operating system, if a valid record is still available in the client’s cache, there is no latency introduced. However, if the client needs to perform a DNS lookup over the network, the latency can vary greatly depending on the proximity of a DNS name server that can provide a valid response. […]. It is therefore important to reduce DNS lookups more than any other kinds of requests.

Every time you serve resources (images, CSS files, JavaScript files, etc.) from other hostnames, you increase the number of DNS lookups for your visitors. A hostname can be either another domain or subdomain. Limit the amount of resources you serve from other hostnames to about 4-5.

To achieve this you can store external images/ resources locally by uploading them to your server and then serving that image/ resource from your own domain. The downside of this is that it could increase your bandwidth usage.

In some cases you will not be able to reduce the amount of DNS lookups or store the image locally (e.g. when inserting ads on your page). In order to see what external resources you are serving on your blog, open up the Firebug console within your blog and go to NET > ALL. Alternatively, you can also analyze your page using tools.pingdom.com and analyzing the timeline to find out.

Read more about this rule here:

 

Put Scripts at the Bottom, CSS Files at the Top

Most browsers will parse and execute JavaScript files before they load any other resources, since JavaScript can change the functionalities of the page. This can affect download parallelization. If you put scripts at the top of the page, your visitors could end up seeing a blank page for a while until the JavaScript is loaded. This can affect performance.

In order to load the content first, place JavaScript at the bottom of the page, or just before the script is actually needed. If your content depends on certain scripts to display correctly, consider separating your scripts into two categories: The critical ones that need to be placed at the top of the page for the page to load correctly, and the ones that can be executed once the content has been loaded. Make sure your CSS files are placed at the top of the page, inside the header. This is usually the case. If that is not the case, it may avoid  download parallelization.

The plugins we install later on will normally deal with this issue. However, it is worth mentioning it here if the plugin does not do a perfect job.

Loading JavaScript Asynchronously

An advanced and great way to improve the perceived performance of your site is to load scripts asynchronously instead. With the help of a plugin, we can ensure that all scripts are being rendered in parallel, and in a way that does not affect or block the loading of the page. This is usually done with the help of Head JS.

On the next chapter, we will put this to use automatically. If you want to include this manually to your websites, please inform yourself at http://headjs.com/ or follow the steps described below.

JS, CSS and HTML Optimization

A very important step in your efforts to speed-up WordPress is to optimize all JS, CSS and HTML of your blog. Modern WordPress blogs are built with Java Scripts (JS) to create interactive effects within web browsers and Cascading Style Sheets (CSS) used for rendering the look and formatting of your blog.

Each page of your blog is coded in Hyper Text Markup Language (HTML), which is the standardized system on the World Wide Web. How to See your Source Code. First of all, there are two parts

How to See your Source Code

First of all, there are two parts on a page, the head, and the body. The head contains all the invisible elements that the user can’t see in their browser and add interactivity, effects, and looks. It is delimited by the tags <head> … </head>. The body contains the content that users see, text, images, links, but also some interactive effects and cosmetics for your blog. It is delimited by the tags <body> … </body> If you want to see the code of one of your page, click the right button of your mouse and select View Page Source (in Chrome).

A new tab will open that let you see the HTML code. You will see the code in a new tab. Notice that you can also type“view-source:” before the URL to see the source code.

Identify JS, CSS and HTML

Java Scripts are added into your pages by plugins: SEO plugin, Analytics plugin and many other plugins that add functionality to your blog. Some Java Scripts work only in the HEAD at the top of the page, some others at the bottom of the page just before the </body> tag. Some may work in both positions and it all depends on how they were designed to work. You may have lots of them in your HEAD. This one is from

Some may work in both positions and it all depends on how they were designed to work. You may have lots of them in your HEAD. Each time the page loads, that’s a dozen of connections that are slowing down yourWordPress’ load speed. Later in this chapter, I am going to show you how you can group them, minimize them and move them to the bottom of your pages.

Don’t worry, you won’t have to touch any pieces of code. Cascading Style Sheets are mostly located in the HEAD of your blog. They are part of your theme and the number of styles you have depends on the design of your theme. They have to load quickly in order for the blog to look the way it should look. Have you ever seen a site that looks broken? That’s because the CCS failed to load. The CSS looks like this in the code.

Speed Up WordPress Performance - image Stylesheet-Links-in-a-Page-Source on https://trunk.ly

There is a way to optimize your HTML so your pages load faster. The JS, CSS and HTML optimization can easily be done with a single plugin called “Autoptimize”.

Autoptimize Plugin

Ready to auto-optimize your blog? I bet you are. Go to your plugin section and look for “Autoptimize”.

Speed Up WordPress Performance - image autoptimize on https://trunk.ly

In the main menu, go to the “Settings” section and you will see “Autoptimize”.

Speed Up WordPress Performance - image Autoptimize-Options-‹-Wordpress on https://trunk.ly

Check the box for

  • Optimize HTML Code
  • Optimize JavaScript Code
  • Optimize CSS Code

The fourth section is for your “CDN Options”, which you are going to leave blank for now.

Click the “Save Changes” button.

Now, you should go to yourFront Page and browse a few pages of your blog to see if everything is alright. It might happen that something in your blog gets broken due to the optimization you have just done. If this is the case, uncheck one option and click the “Save Changes and Empty Cache” button so you can see a new version of your settings.

Do this for all options one by one until you find the option that is causing the problem. A certain optimization may mess-up with your theme or a particular plugin. In this case, you can replace the faulty plugin by another, which will be more compatible, try one of the advanced settings, or just don’t optimize.

Autoptimize Advanced Settings

If everything is alright with the basic settings shown earlier there is no need to go further, but if something is broken on your blog, you may want to try the different advanced options and see if that solves your problem. Unselecting the different options one by one earlier should have shown you if the problem is for JavaScripts or CSS. Use the advanced settings only for the one that is causing the problem.

If the problem is JavaScripts related, it is more likely due to a script that should not be moved to the bottom of the page. You may try the following options.

Check the box for “Force JavaScript in <head>?” and all yourJava Scripts will stay in the HEAD section. Checking the second option might be useful as well. Notice that there is a list of excluded Java Scripts auto-populated by the plugin, more on this section later.

You have to click the “Save Changes and Empty Cache” button at the bottom of the page. Navigate your pages to see if this works. Now, this is a compromise as performance will not be as good as if the Java Scripts were at the bottom. When you navigate your site and see something that’s broken, identify if this is a theme or plugin problem. It might be your special comment box or related posts that are broken and you can then identify the faulty Java Scripts this way.

Server Tweaking

Notice: This step will not talk for everybody, unfortunately. I cannot teach and do not know how to “tweak” all different server combinations. These differ based on your own hosting company, control panel, VPS vs. Dedicated Server vs. Cloud Server vs. Shared Server, etc.

I will stick with some simple configurations for a shared hosting environment with CPanel, since I believe that will be the case for most of the readers.

CPU Throttling

Inside your CPanel, you may find a Log Tool called “CPU Throttling”. Go check it out. Once there you will be able to tell if your server experienced any CPU limiting factors (too much CPU processor overload) in the past hours.

Any number below 600 seconds in a given hour should not represent a problem for your visitors (number taken from BlueHost’s suggestions).

If you experience frequent and high levels of CPU Throttling, these could be some steps to improve performance:

  • Optimizing Databases
  • Removing plugins that may cause your blog to perform slowly (more into this in a sec)
  • Deleting Cron Jobs that use too much RAM
  • Upgrading your hardware (moving to a more robust Virtual Private Server for example)

To check out if you have any unoptimized scripts or queries that may cause your blog to underperform, your server may have a log for slow MySQL queries. You would have to:

  1. Login into cPanel.
  2. Look for the section called “Files” and click the icon called “File Manager”.
  3. Start in the “Home Directory”, choose Show Hidden Files, and then click Go.
  4. Once in the File Manager, look on the right side for a folder called “tmp” and navigate into that folder.
  5. Once inside the tmp folder, find a folder called “mysql_slow_queries”.
  6. Navigate inside that folder.

Look for the files with recent dates and right-click on one of those files and choose “Code Edit”. This will show the log details.

Look for the logs where the Query_time is over 2 seconds. Do not freak out if you do not understand most of the code, I don’t understand anything either. Instead of trying to decode each part of the shown log, try to find any hints that could point to things you may recognize, especially plugins.

In the following example, I spotted a plugin, “SEO Autolinks & Related Posts” that was causing unnecessary server load (since I wasn’t really using it), by seeing “100” and remembering that the Plugin was comparing 100 posts to each other in order to display related posts.

If you find something similar, consider deleting the plugin (if unnecessary) or trying to reconfigure it.

Hotlink Protection

Hotlink protection can prevent users and other webmasters from using your own bandwidth.

In most cases, enabling Hotlink protection is a good thing, because it will prevent users from posting images from your own site on other sites and using your own bandwidth in the process.

However, for certain services to work, Hotlink has to remain disabled. More specifically, disable Hotlink Protection before using the SpriteMe.org service, since SpriteMe needs to have public access to your images.

To enable Hotlink protection, go to your CPanel (if that is the case) and find Hotlink Protection inside Security. Otherwise, ask your hosting provider if your host supports this feature. Inside Hotlink Protection, you are able to allow URLs to have access to certain file types specified below.

WordPress Hacks & Tricks

You have now reached the last chapter of this guide and already enjoy a double A score with a very fast page load time if you have applied all technics shown. Unfortunately there are a few more issues I’d like to bring your attention to: WordPress is vulnerable and there are a couple of things you can do to prevent or minimize attacks from hackers trying to access your dashboard through the login page.

When this happens, your blog can slow down due to the numerous requests made to the database during several hours. WordPress has a few default settings that are not ideal and can at times burn a lot of CPU power and RAM, and slow down your blog, despite all the efforts you have done to optimize it. WordPress is the target of Spammers who use software to Spam comment your blog.

If you allow this to happen, these junk comments can jam your database and affect performance greatly. Ping Backs & Trackbacks can also be a real issue and your blog may be used to DDOS attack other sites. This too will considerably slow down your blog

I strongly advice you to read our WordPress Security Guide

Tweak Remaining Suggestions

Head over to GTMetrix.com once again

  1. Insert your homepage or any other type of page (single post, single page, etc.)
  2. Check your Page Speed and YSlow grades.
  3. Use the breakdown in order to analyze what suggestions PageSpeed and YSlow have for you

You may find that you can still optimize certain specific things, such as small image improvements, forgotten image attribute specifications, or else. This step is an advanced way to see what things you could improve on your blog.

However, do not freak out and try to get 100% at any cost. In most cases, you will not be able to achieve perfect Page Speed scores and YSlow grades. In fact, you will not want to, because you may have certain external scripts, that you cannot or don’t want to host locally, even if they increase the amount of recommended DNS lookups

Measure Your Optimized Blog

  1. Once you have gone through all of the possible tweaks, repeat step number one.
  2. Go to the different web page test sites to be able to track your results.
  3. Consider using the free service: http://www.showslow.com to be able to get Page Speed, Yahoo Slow, and Dynatrace scores over time.
  4. Installing the following plugin: GT-Metrix for WordPress will display the loading times of your blog within your dashboard.
  5. If you determine that your blog is not performing the way it should even after having done all of these improvements, then it is time to consider upgrading your hardware and considering a more powerful hosting solution
  6. If you are running on a shared hosting environment, in some cases certain hosts are not well optimized for WordPress. On the other hand, your server may be too crowded or is not able to handle the amount of server load you need.
  7. Shared Hosting servers recommended for WordPress include: Siteground 
  8. Check the next step for an introduction to upgrading your hardware

Hardware Upgrades

At a given point, if you are hosting too many sites, or your website has become much more popular and is receiving much more traffic, you will want to consider upgrading your server in order to be able to handle the extra load.

This will increase server reliability, better user experience, a wider range of performance tweaking possibilities, better customizations, and more security, among others. The downside is the extra cost involved in purchasing (and maintaining a virtual private server or a dedicated server).

A great alternative is to move your blogs to a virtual private server. Basically, a VPS is also a server that is being shared amongst different websites. However, the server is being “split” and you are given a certain CPU power, memory capacity, etc. just for you. This means, even if the website being hosted on the same server receives a big spike in traffic, it won’t necessarily affect you since you have “reserved” your share of the server just for yourself (if your server crashes then it will affect both of you though).

In terms of price, a Virtual Private Server is obviously much more expensive, but it will grant you much more CPU capacity and the possibility of configuring your server to your needs. It also offers good scalability, which means you can increase your server power to meet your needs.

The extra of having a VPS instead of a shared server is being able to customize the server to your needs. You will be able to take advantage of certain functions such as Opcode (APC, Memcached) for better caching performance.

You can decide how much CPU, RAM, and Bandwidth you need and scale your server as you see fit. Note: A future advanced edition will cover deep customization options for websites running on virtual private servers or dedicated servers. Stay tuned.

Troubleshooting

If you ever experience a blank admin panel after having activated a recently installed plugin, the most common reason for this is the plugin conflicts with another plugin you had installed already.

Another reason might be the fact you have exhausted all available memory. There is a very simple way to deactivate a recent plugin you installed and recover access to your admin panel

  1. Via FTP, go to the folder where your blog is installed and search for the directory: “wp-content/ plugins”
  2. Find the folder of the plugin that caused it.
  3. Rename the folder to for example: “PLUGIN-NAME.hold”

Now access to your WordPress Admin Panel once again. The plugin will be deactivated automatically since the location has been changed.

Resources and Bibliography

Web Page Test Sites

Image Optimization

Server Software

NGNIX Configs

Apache Configs

Varnish Configs

Leave a Reply