WordPress is an amazing platform that allows you to make your own website. For this, there are plenty of online resources that can guide you every step of the way. However, not all of them are tailored towards building a speedy site.
Remember that WordPress-built sites are prone to being slow since they are made with lots of moving parts. Plugins, themes, security issues, CSS customizations – there are plenty of factors that may hurt your site’s performance. In turn, this can inhibit your site’s profitability since the online audience hates slow websites (about 40% will leave if a page loads for more than 3 seconds).
Don’t worry – there are several things you can do to speed things up and improve user experience. Below are seven WordPress hacks you can start with:
1. Prevent “Bandwidth Theft”
Whenever users content such as images, videos, and infographics on your site, they are utilizing your web host’s bandwidth.
This is why it’s ideal for growing WordPress sites to use a capable web host that can match your traffic needs. However, you may be “leaking” bandwidth through users that embed your content via the URL. This is called “hotlinking”, and it can be prevented by adding a bit of code in your root .htaccess file.
2. Enable Lazy Loading
“Lazy Loading” means loading the page elements above the fold first. This is the upper area of a web page that’s instantly visible upon loading. The rest of the page will then be loaded once the user starts scrolling down. It is a brilliant concept that can significantly boost the loading speed of any page. You can easily implement this using a plugin like Lazy Load for WordPress.
3. Replace PHP with HTML where applicable
A lot of modern WordPress themes and plugins are loaded with PHP-based design elements that bloat a code’s size and slow your site down. Some PHP codes are embedded within HTML codes in elements like your header, sidebar, footer, and so on.
This is an inefficient way to run code and can be fixed by replacing the PHP lines with plain HTML. To check these codes, you need to go to Appearance Editor from your WordPress dashboard and then choosing the specific theme you wish to edit.
This, however, is a little more advanced and require a bit of coding knowledge. For your reference, you can check out this post by John Pozadzides.
4. Blacklist Bandwidth-Hogging IPs
Sometimes spammers and problematic networks can slow your site down. There are also spam bots that visit your site in the guise of web traffic. The reason why this kind of problems exist varies. But whatever the reason, you can use the following code to blacklist the identified IPs from your site:
<limit get=”GET” post=”POST” put=”PUT”>
allow from all
deny from 123.456.789
You can deny as many IP addresses as you need using the code above. Just remember to lay down the necessary security protocols to prevent other forms of spam. For this, you can use a service like CloudFlare.
5. Implement Caching
There are two types of caching that can speed up a website’s loading speed: server-side caching and client-side caching.
Server-side caching means caching your databases, objects, and other assets necessary for running your site. The good news is this can easily be implemented and optimized using a tool like W3 Total Cache. Aside from site-wide caching, it also minifies your code by eliminating whitespaces and comments.
When it comes to client-side caching, you can extend the expiration date of cached resources in browsers by a month adding the following code in your .htaccess file:
ExpiresDefault “access plus x“
Remember that the ‘x’ can be replaced by your desired duration. For example, you can add “access plus 2 months” or “access pus 3 weeks”.
6. Implement Compression
Adding high resolution images to your posts and other elements such as content sliders and backgrounds can significantly slow your site down. Remember that you should always scale images to the resolution they’ll be shown on screen. This will maximize bandwidth usage without compromising picture quality. To make this easier, you can use the WP Smush plugin.
Aside from images, you should also implement compression in other areas of your site. For this, you can use WP-Optimize.
This plugin helps by clearing up spam comments, unapproved comments, trackbacks, pingbacks, and other trash that may have accumulated in your database.
7. Use a Content Delivery Network
Okay — this may not be a WordPress “hack”, but using a CDN is extremely effective for speeding up sites that rely on lots of static files such as images and CSS. CDNs work by utilizing a network of globally distributed servers in transmitting data. A CDN service will also make sure that the transmission occurs from the nearest servers to speed up the connection between the site and user.
WordPress is indeed a platform with a smooth learning curve, but it has a high ceiling when it comes to mastery. It may take you just a few hours to get a site up and running. But it may take several months of optimization for you to perfect your site in terms of design and performance.