Optimizing WordPress on Linux Hosting Servers

Reading Time: 7 minutes

Optimizing WordPress on Linux Hosting Servers

There is always everything to be said for simplicity and when you need to put something together yourself as much of it as possible is preferable. This can certainly apply to people assembling their own website. If you’re a multinational corporation or anything similarly sized you’ll need the impressive and supremely dynamic website that a professional webmaster will build for you. But for a lot of smaller ventures of all different sorts it makes more sense to do it yourself and nine times out of 10 people do that with a WordPress website.

If that’s you then you pretty much need a Canadian web hosting provider like us here at 4GoodHosting that provides Linux server hosting for websites. Linux hosting is optimized for WordPress sites and the fact it’s an open-source OS means that these hosts will be able to offer WordPress hosting Canada for less – something that is going to be very appealing for certain small business owners too. Even VPS hosting with a Linux server may be the best choice for any business website.

So the basics of it is that any WordPress site that has Linux server hosting behind it is off to the best start possible when someone is bringing their website online for the first time. It will have the best array of resources made available to it, and of the aspects that makes it even easier to modify your site on your own here is with our cPanel controls. Some of you may be just starting to explore that yourselves, and so what we’re going to do here with this week’s entry is explain some approaches to optimizing WordPress on Linux hosting servers.

Page Speeds Prominent

And it is wise to make optimizing your WordPress one of your top priorities. Nothing speaks to this more than the importance of page speeds these days and also considering that Google’s ranking algorithm has adapted to this new reality given the importance website browsers will put on it. It is well known that a slow site means less visitors and if you have a WordPress website for a small business or venture you won’t be able to afford that in a lot of cases.

So what’s going to follow here will be an overview of some of the key optimization techniques that could contribute top optimal performance from your WordPress site and your Linux server hosting. But be aware these optimization techniques may be limited based on the hosting service you are using, and in particular with free or inexpensive shared hosting plans that may sound good but leave your site at risk of being unvisitable for any number of different reasons.

Let’s start with the fact that if you are using shared hosting then you will have little control over your server setup and performing advanced optimization techniques will not be possible. Also note that many managed VPS providers do not provide full control (root access) to your VPS. It’s for this reason that Linux server hosting powered by enterprise SSD drives are recommended for running a WordPress web site. Having full control (root access) over the server to perform server-side optimizations is definitely preferable.

And the best place to begin is with a solid software stack like LEMP that promotes you getting the best of your WordPress installation. This stack is built with Nginx, smartly designed software used to run the busiest sites on the Internet. Taking advantage of it will improve the performance of your WordPress site and server quite significantly, and installing Nginx, MySQL and PHP-FPM using a guide is not difficult at all. But you will need to make sure that you are running the latest version and ensuring all your WordPress code, Nginx and the other server software are up to date. Jump up from PHP to PHP 7 too if you can, as PHP 7 uses 30% less memory and serves 3x more requests.

Remember as well that disabling the unused services running on it to reduce server load will also be hugely beneficial for your site. The server will handle more traffic without crashing some of the important services like your database server.

Caching Important Too

You need to be on top of you caching too if you want to be assured your WordPress site is able to move as fast as possible when it needs to. Implementing some good caching techniques will allow you to improve the performance several hundred times. Here are the ones industry experts consider to be the most effective caching techniques, and this approach is of the highest level of importance when it comes to server-side caching.

Start here by adding an opcode caching like OPcache to your PHP to supercharge its performance. This is very simple method as OPcache comes with the PHP core by default. Just make sure that your PHP version is greater than 5.5, and as stated above you will be best served with PHP 7 with WordPress.

Caching Plugins is helpful too, and it is something you should do with posts, pages, and other static files and the good news here is that installing a caching plugin in WordPress is fairly simple nearly all the time. But addressing the post-installation configuration may be something you need to do first. Almost all caching plugins provide user documentation for easy and quick understanding of how to configure the plugin for maximum performances. If you can’t get it on your own there are plenty of online free tutorials for w3 total cache.

You’ll also want to leverage browser caching, as this is another technique for best implementation of WordPress onto a domain name and spot along the information superhighway with the best Linux web hosting Canada. What that means is the client’s web browser will download and store the assets like CSS, JS and images into the local storage for a certain amount of time. The reason that’s advantageous is it means the number of requests for each page will reduce the demands being put on the server.

Here’s how to do it by simply adding the lines below into your .htaccess file:


<IfModule mod_expires.c>

ExpiresActive On

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 text/html “access 1 month”

ExpiresByType application/pdf “access 1 month”

ExpiresByType text/x-javascript “access 1 month”

ExpiresByType application/x-shockwave-flash “access 1 month”

ExpiresByType image/x-icon “access 1 year”

ExpiresDefault “access 1 month”



Those using Nginx instead of Apache as their web server will need to do things slightly differently by adding the following lines in the server block for your domain name:

location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {

expires 365d;


Additional WordPress Optimization Techniques

Many of the techniques we mentioned earlier connected to WordPress hosting in Canada cannot won’t be doable if you currently have a shared hosting arrangement where server-side optimizations need to be made with special access to the hosting environment. But what we offer to you here below is a nice exception to that, and you’ll find it is frequently recommended to and from people who work with Linux web hosting regularly.

Next up with recommended WordPress hosting optimizations is to add gzip compression. The reason for that is Gzip compression is necessary in order to decrease the size of data that is being sent from your server. Enabling Gzip compression is also quite straightforward, and you can do it yourself by adding the lines below into your .htaccess file:

<IfModule mod_deflate.c>

# Compress HTML, CSS, JavaScript, Text, XML and fonts

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/vnd.ms-fontobject

AddOutputFilterByType DEFLATE application/x-font

AddOutputFilterByType DEFLATE application/x-font-opentype

AddOutputFilterByType DEFLATE application/x-font-otf

AddOutputFilterByType DEFLATE application/x-font-truetype

AddOutputFilterByType DEFLATE application/x-font-ttf

AddOutputFilterByType DEFLATE application/x-javascript

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE font/opentype

AddOutputFilterByType DEFLATE font/otf

AddOutputFilterByType DEFLATE font/ttf

AddOutputFilterByType DEFLATE image/svg+xml

AddOutputFilterByType DEFLATE image/x-icon

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/javascript

AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/xml

# Remove browser bugs (only needed for really old browsers)

BrowserMatch ^Mozilla/4 gzip-only-text/html

BrowserMatch ^Mozilla/4\.0[678] no-gzip

BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

Header append Vary User-Agent


Those using Nginx will place the following lines in the Nginx configuration file:

gzip on;

gzip_comp_level 2;

gzip_http_version 1.0;

gzip_proxied any;

gzip_min_length 1100;

gzip_buffers 16 8k;

gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

Essential plugins / Good Themes / Better Images

We’ll assume that you now don’t need much more convincing about how using WordPress plugins is essential, but also knowing which plugins and plugins are unnecessary because of being coded inefficiently is good to. These ones may affect the site’s performance and so we recommend installing and enabling the WordPress plugins that you truly need for your project avoiding those that might ultimately mean your site’s pages aren’t loading as quickly as they could be.

A lot of the reason why WordPress is as highly recommended as it is for building a website is the way users have some any easy-to-use themes to choose from to give their site a specific look instantly. Plus well-coded themes for WordPress sites make it more likely you’ll have a fast-loading website. It is great that there are so many well-coded WordPress themes out there, and while there are both free and paid ones you may find that the paid ones are worth the slight investment.

What is recommended is some basic research into the themes that will help you to speed up the loading time of your WordPress site. Because again this continues to be focus number one with what is the best Linux server hosting for you. Optimizing your images is a need that is fairly easily met with Linux WordPress hosting controls too, and that’s also a fortunate reality as unoptimized or overly large images can affect the loading speed of your website.

If that happens extensively then you will likely have a situation where visitors are leaving the site. To be time-sensitive with addressing this in your cPanel controls you can save time, bandwidth and improve your search engine ranking by manipulating the graphics displayed on your website. One of the absolute best WordPress plugins for this aim is WP Smush. But even still you may need to evaluate whether or not some images are necessary to represent something. One of the most effective ways to counter images negatively contributing to plage loads or SEO is to reduce the number of images by replacing some of them with text.

The last thing to say here is that while using a CDN (content delivery network) is a foregone conclusion for any self-managing their WordPress website, you will often get the most mileage with WordPress website and Linux server hosting if you minify as many CSS and JavaScript files as is possible given the orientation and infrastructure of the site. This is especially true when certain ones cannot be combined into a single, optimized file and that can apply for JS files too

Anyone who’d like to be assured of having their WordPress site have the best page load speeds possible without getting into the technical workings of it all can go the easy route and have us host your Canadian website with Managed Canadian WordPress here. We’ve done all the work that is required for better performance for WordPress websites and with packages that range from 20 to 60 CAD dollars per month.

Post Navigation