How can I improve the performance of my WordPress website?
This article applies to 123 Reg Premium Hosting packages
This article will outline some tips and tricks for making the most of your WordPress website hosted on a 123 Reg Premium Hosting package.
There are several stages of optimisation you can implement on your website to help your improve your performance meaning your loading times decrease and your website is a faster, more user-friendly site for your visitors.
Please note: You can also read this article for more general tips for running a website on your hosting package.
Linux not Windows
Most hosting packages come with both Windows and Linux operating systems. While both have their good points, Linux is the favoured platform for Content Management Systems such as Joomla, Drupal, and in particular – WordPress.
Optimising your database
One of the best ways of improving the performance of the website is to tidy up your database. This can be done for you by using phpMyAdmin; which will clear any unnecessary data from your database, leaving just the information you need to keep.
How to optimise your database
From your hosting control panel, click on the MySQL Databases button in the Web Tools section.
For the Database you want to edit, click on the Manage button.
From your phpMyAdmin control panel, click on the database from the left hand side column.
Click the Check All link at the bottom of the list; this will select all of the tables in your database.
From the drop down list underneath the list of tables, select Optimize table.
Once complete, you will see a message that your SQL Query has been executed successfully.
GZIP Compression is used to lower the amount of data that is sent to your visitors, which means that your website will load faster.
This is done by adding the below code to your .htaccess file. Your .htaccess file allows you to configure your server. If you don’t have one already created, you can do so by creating one with the file manager, or uploading via FTP. If you do have one, simply add the below code to the bottom of the file.
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
# remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0 no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
Caching allows your vistor’s browser to remember images on your site. This means that once they’ve visited once, the user won’t need to download the image again, which vastly increases the load time of your website.
This also applies to other elements of your page, such as scripts and stylesheets.
To enable browser caching, you will need to add the below code to your .htaccess file, in the same way as you did with GZIP Compression.
## BROWSER CACHING ##
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 2 days”
## BROWSER CACHING ##
Optimising images essentially means not having images that are larger than they need to be. Large images can impact the speed of your website’s loading, and downsizing will mean that there your site is faster.
There are plenty of tools and plugins that you can use to reduce the size of images without compromising on the image quality. Once such example is Kraken.io which will allow you to upload your images, and resize them in both lossless and lossy quality.
WordPress users can also use plugins such as WP Smush.it to automatically reduce images sizes without losing image quality, it even works on images you have already uploaded!
Using a redirect on your website can increase the loading time as the browser will have to make the same requests twice. You should place your website files directly in the root folder of your hosting space rather than a subfolder, and then use a redirect rule to pass requests further down.
Running a high number of plugins on your WordPress account can slow down the performance of your website, as each of these plugins may run, or attempt to run, every time your site is loaded. Multiple plugins can really mount up the loading time, causing considerable impact on your website’s performance.
If you find that you are experiencing high loading times, and have plugins installed, try uninstalling them one by one, to see which one was affecting your site’s performance. Then, if it is not essential to your site, you can decide whether or not it’s worth keeping if it jeopardises the performance of your site.
To deactivate or remove plugins, simply log in to your WordPress control panel, then select the Plugins option from the menu bar. If the plugin is active, click on the deactivate button; or to remove the plugin altogether, deactivate it, and then click on the Delete option.
Tip: Disable Caching plugins
Despite what they advertise, caching plugins are not recommended on a shared hosting environment as they are more designed and suited for VPS and dedicated packages. They can diminish performance rather than improve it.
Example of popular caching plugins are WP Super Cache and W3 Total Cache.
Change your Theme
Looks can be deceiving and so can WordPress themes. A theme can look clean and elegant but it could have been concocted with duct tape and black magic, which can seriously hurt the performance of your site.
Try different themes and balance between looks and efficiency.
Minify your code
Essentially, this means removing white space from your code. This white space is used to make your code easily readable to the human eye, however, from a computer’s perspective, this just leads to an increased file size, increasing the loading time.
Taking out the white space can be done by hand, or there are third party tools that can be used to do this for you. These are especially useful if you have long pages of code: HTML Minifier and Better WordPress Minify.
Put your Stylesheets and Scripts in the right places
Making sure your stylesheets (.css) and scripts (.js) are in the right place can do wonders towards improving your site’s speed. Your stylesheet should be linked at the top of your page code, while your scripts should be added at the bottom of the page code. Placing these incorrectly can mean that your browser has to process the entire HTML document before it can display the page, meaning that any visitors will see a blank page for a few seconds before seeing your content.