There are many different ways you can optimize a WP website, we are including here the only couple of the most popular techniques to optimize your WP, your experience may vary. We always recommend that you check with a WP developer or WP consultant if you are unable to optimize or maintain your WP on your own.
Lately, we have been seeing more issues with total page size (content size) for the home page or any other pages within WP caused due to bulky images, large CSS files, large fonts, lengthy JavaScripts, or bad themes in general! Before you go through all steps in this tutorial, please use the website tester tool from Pingdom (below), and confirm your total page size. If your page is a couple of MB in size, do not expect that your website will perform well!
NOTE: For the test data to be relevant always test using the same location, and try to use locations in the USA since your site is hosted in the USA – otherwise you are adding other factors such as latency due to distance in the mix, which makes it even harder to optimize.
Let’s say that your home page is 5 MB (refer to the Content Size by content type section under the test results), except that on average visitors may wait up to 5 seconds for the page to load. So if you have a site that is over 1 MB or any page within your site is larger than 1 MB, you should immediately look into optimizing your images (as outlined in the steps below) or optimize your themes, CSS files, JavaScripts being used, etc. Google guidelines suggest that a web page should load within 2 seconds in order to consider it as reasonably good speed, so your aim should be to get it below 2 seconds if possible.
If your page size is large (> 1MB) – please, review the sections of the tutorial below: Image Optimization, Themes, check the Smush It, and CSS/JavaScript Minification tools outlined below. Then you can check the Plugins, and Caching part of this tutorial.
Plugins
The easiest way to optimize your WordPress site is to disable and remove any unnecessary plugins, which might be slowing down your site without you even knowing it!
You can test which plugin is slowing you down do by deactivating them one by one and test what will increase or decrease your loading time. More plugins you use, the higher the chance that your WP will not perform as expected.
If you have a lot of plugins, you can simply rename your plugins folder in order to deactivate ALL plugins at ones, the plugins folder is located under sub-folder: “wp-content” and called “plugins” – you can use FTP or your control panel file manager to rename it to something like “plugins.bak”.
Slow Plugins List: Please, make sure to review our list of slow plugins article located here – and disable if you can anything you see here, including JetPack!
You can also use third-party plugins which can help you to detect what is slowing down your site, here are few that we:
https://wordpress.org/plugins/query-monitor/ (Free)
https://wpperformanceprofiler.interconnectit.com/ (Paid)
You can also check your entire WP CPU and Memory consumption with this plugin:
https://wordpress.org/plugins/server-ip-memory-usage/ (Free)
Themes
Optimizing your theme is the next step of optimizing your site performance. If you are using 3rd party themes we recommend that you test your themes and their performance by switching to different (default WP themes) and comparing the load time, and performance of your site.
We have seen 3rd party themes that are slowing down a website as bad as 3 times! Do not use themes that are not tested or with suspicious origin.
Advanced users only: The best practices when trying to optimize your own custom themes is to:
- Files per page – reduce the number of files needed to be displayed on your pages, combine multiple CSS files into one single file
- Query Optimization – it is a good practice to hardcode static values into your theme like charset, site logo, menus, etc
- Offloading – any of your static content like images, videos, HTML and CSS files can be offloaded to another server. Even only a small part of your content to be offloaded can significantly increase your site performance. For this purpose, you can use free services like Flickr or YouTube or you can get the additional server for offloading your static content.
Caching, Caching, Caching!
Apart from removing slow plugins and using optimized themes the most important feature, you need for your WP is the use of a Caching plugin!
These plugins will cache your dynamic pages, and posts as static files, reducing the time for delivering them to your site’s visitors. The best caching plugins are:
- WP Super Cache – this plugin is one of the best, and highly recommended to be used if you are experiencing performance issues. You should try to use one of the 2 plugins listed here, but not both at the same time.
- WP Total Cache this plugin contains many different features besides page caching. It includes minification of your content which will decrease the file size of HTML, CSS and JS scripts, Database caching, Object Caching, compatibility with CDN etc. You can use this plugin with our Redis cache, as outlined below.
Use the latest PHP Version
Make sure that you are using the latest PHP version available in your web hosting control panel. We recommend the use of PHP 7.2.
WooCommerce Patch
Make sure that you read this article if you are using WooCommerce as an online store.
Images Optimization
As a general rule of thumb, larger files take longer to download than smaller files. Web page download time, also known as the Page Load Time depends on the total size of content assets being downloaded from hosting servers to the requesting browser. High-quality bulky images are the largest contributors to Web page size, degrading page speed and agitating visitors eagerly waiting for the web page to load. The following image optimization best-practices go a long way in reducing the negative impact of images on website speed:
- Format Selection: Use JPGs when quality is a high priority and image modifications are not required before uploading it. JPGs can take limited processing and modifications before image quality degrades sharply. For images with icons, logos, illustrations, signs, and text, use PNG format. Use GIFs only for small or simple images and avoid BMPs or TIFFs.
- Proper Sizing: Save valuable bytes of image payload and match the dimensions (width) of your Web page template. Use browser resizing capabilities to make images responsive by setting fixed width and auto-height instructions.
- Compression: Image compression should be a thoughtful tradeoff between image size and quality. For JPGs, a compression of 60-70 percent produces a good balance. For retina screens, increase (JPGs) image size by 150-200 percent, compress by 30-40 percent and scale it down again as per required dimensions.
- Fewer Images: Keep the number of images to an absolute minimum.
Image Optimization Tools
Online Tools
- TinyPNG
- Kraken.io
- JPEG Reducer
- JPEGmini (app available for OSX, iOS, Windows)
WordPress image optimization plugins
- CW Image Optimizer
- Lazy Load
- WP Smush.it (support ended)
- Radical Image Optimization Tool (RIOT)
Minify CSS and Javascript
Minification of resources means removing unnecessary characters from your HTML, Javascript, and CSS that are not required to load, such as:
- White space characters
- New line characters
- Comments
- Block delimiters
This speeds up your load times as it reduces the amount of code that has to be requested from the server.
You can minify your CSS and Javascript with WordPress Cache Enabler or online tools such as Minify.
Other Tools
There are many other plugins for WordPress which are intended for optimizing your site. Some of them are:
- WP Smush.it – compressing images without decreasing their quality and dimensions
- WP DB Manager – a plugin for managing and optimizing your WordPress database
- Better WordPress Minify – specific tool which allows you to minify your CSS and JS files.
- Online CSS + JavaScript Minification Tool: http://www.minifier.org/
- Head Cleaner – cleaning tags from your WordPress header and footer speeding up the loading of JavaScript and CSS.
Caching
Web crawlers protection (robots.txt):
Web crawlers or so-called web spiders (robots) can cause significant load on your WordPress installation, and further slow down your site and put extra load on your server. We have an article available on the subject, which we can recommend that you review and implement ASAP.
Other useful optimizations:
- Optimize your Database tables – you can do that either using the WP DB manager plugin or manually using a tool like PHPMyAdmin.
- Check the size of your “wp-options” table – Bad plugins, themes will increase the size of this table and slow you down. You can install a plugin like WP Clean Up Optimizer for similar purposes.
- Turn off Post Revisions feature, if you do not need it – basically, this feature is creating new row after each edit of your post. This may lead to an unwanted size of your database and wp_posts table. You can turn off this feature by adding one line to wp_config.php found in the installation directory:
define(‘WP_POST_REVISIONS’, false);
If your site was running with this feature enabled, you can delete all unnecessary post revisions by running this query through phpmyadmin (do this with care, and backup your database first) :
DELETE FROM wp_posts WHERE post_type = “revision”;
- RSS Pings and Pingbacks – your site can be slowed down by timeouts caused by your ping servers listed in your ping list, to disable this – navigate to your WordPress admin and then to Settings -> Writing
Notifications – Another option you can try is to disable the notifications to any blogs linked to in your article: to disable this – navigate to your WordPress admin and then to Settings -> Discussions
In addition to the above steps we recommend that you review our general Performance Optimization Tips located at:
https://www.hndsea.com/clients/knowledgebase/195/WEBSITE-PERFORMANCE-OPTIMIZATION-TIPS.html
We hope that you found the above information useful, and manage to successfully optimize your WordPress web site.