How to optimize WordPress performance
You should optimize your WordPress site and server for the best possible outcome. This thing is necessary for all the sites whether containing a large traffic or a small traffic.
It increases the speed of your site, which provides a great experience to your users and improve your ranking because loading time is also considered in search engines.
There are a lot of tricks through which a user can optimize the WordPress site performance. We'll see to some of them in this tutorial.
Choose a Good Web Host
Your site's performance greatly depends upon your chosen web host. So choosing web host is a very important decision. If your web hosting service is not quite good, then other tricks to increase your site's performance may not work.
Do a complete research about the host you are opting for. Read its reviews and comments from the experts. It's better to pay some extra bucks rather than choosing a cheap one and compromising with quality.
Use a Caching Plugin
A caching plugin serves a cached version of your page to the user's browser instead of generating every page on the fly.
It is important because WordPress is written on PHP, which is a server side programming language. It means whenever someone visits your site, WordPress runs a process to fetch the information and then display it the user's browser which is quite time consuming and my slow down your site.
Use a fast Theme/Framework
Your installed WordPress theme should be fast and well-coded. Don't choose a theme with lots of features which you don't need, it will negatively affect your site.
Default WordPress themes are best to use as they are well-coded and light-weighted to load.
CDN stands for Content Delivery Networks. It is a network of geographically dispersed servers which delivers cached content based on the geographic locations of the user from the websites.
Static resources of a site like images, CSS files and scripts, stop the page from displaying into a user's browser. CDN can resolve this problem by serving static files to the users from their closet servers across the world. Due to this load on the primary server also reduces and hence gives the better result to the users.
Optimize Images for Speed
Images are one of the heavier elements and take longest time to load in your site. Most websites have a lot of images on each page.
Before using images, make sure that they are properly optimized for the web.
Split long posts into smaller pages
For a long post article with a lot of images, it is better to split them into multiple pages. WordPress has a built in functionality for this.
Just add <!?nextpage--> tag in your article wherever you want to split your page.
Split Comments into Pages
Some articles may have a lot of comments received. Loading all the comments in a single page will take a lot of time for loading. It is advisable to split the comments into multiple pages to reduce the load time.
WordPress built-in solution for this is go to Settings > Discussion and check the box Break comments into pages.
Remove Inactive Plugins
Plugins which are used no more are needed to be uninstalled quickly. Many users forget after installing plugins which are not even used any further on their site.
They increase your site size and slow down the speed of your site.
Keep your site Updated
WordPress automatically updates its site regularly. Updates helps to fix bugs, security issues, and offer some new features.
It is essential to keep your site updated on a regular basis. All plugins and themes should also be regularly maintained and updated. Not updating your site regularly may cause some security issues for your site.
Don't upload Videos to WordPress site
Directly uploading videos to your WordPress site consumes a lot of bandwidth. These video qualities can't be optimized for high performance by WordPress.
It is better to embed videos in WordPress from video hosting sites like YouTube, DailyMotion, Vimeo, etc. it improves page load speed of your site.
Optimize WordPress Database
After some time when you start using your WordPress site, your WordPress database may have some unused data which you don't need any more. Your database needs to optimize your database table for better performance.
There are some plugins for this which allows you to clean your WordPress site by deleting trash, pending spam comments, orphaned meta, etc. it also optimizes database table structure and gives you a fast responding database.
Enable Gzip Compression
Serving a compressed version of your site to your visitors results in less loading time due to the smaller size.
You can enable Gzip compression either from your cPanel (if your host allows so) or from a WordPress plugin. You can also enable it from your .htaccess file.
Install well-coded Plugins
There are a lot of WordPress plugins available but all of them are not well-coded. Always go for the plugins which support latest WordPress version and are highly optimized.
Poorly developed plugins not only slow down your site but also affects other plugins functionalities.
Replace PHP with HTML code wherever Possible
Plain HTML code loads much faster than PHP codes on web servers. If possible then replace some PHP code with HTML code on your site.
HTML loading time is around 20 times faster than PHP.
Turn off Trackbacks and pingbacks
Whenever someone links to your site, a trackback gets created which utilizes your server and database resources which ultimately affect your site's speed.
So when you don't need trackbacks just disable them from Settings > Discussion, unchecke the box of trackbacks and pingbacks.
Use a Responsive design
Responsive designs are used to load less resource for small screen devices and high resolution images for larger screens. This way small screen users won't get a heavy image and large screen users won't get a smaller highly compressed image.
Link CSS stylesheets in the Head tag of HTML coding. Using it outside the Head tag prevents the browser from displaying content of the page as soon as page is loaded.
This trick will not reduce your site's size, but it will help in loading your site a little faster.