We’ve seen a lot of slow websites over the years and as a result we’ve put together this quick start guide to help people better understand how to speed up WordPress and make it more secure at the same time.

#1 – Page Caching

This is something that anyone can do by adding a plugin like W3 Total Cache to their site. The reason for it is quite complex but trust us, with over 5 Million downloads and a 4.5+ star rating you can rest assured that they are doing something right.

#2 – Too Many Plugins

It’s tempting to do (we know) but as a general rule, the fewer plugins you have the better off you will be from both a security and performance point of view. We like to think of it like going to Tim hortons, you can’t get the Boston Creme every day, well if you do you are going to be kinda slow too.

#3 – Enable Gzip & Expire tags to your .htaccess file

Your server that your site is hosted on needs to support things like Nginx but assuming it does (as all good modern web hosts do) Here’s an example of what we’ve seen speed up website by as much as 200%!

<IfModule mod_expires.c>
 ExpiresActive On
 ExpiresDefault "access plus 1 month"
 ExpiresByType image/jpg "access plus 1 year"
 ExpiresByType image/jpg "access plus 1 month"
 ExpiresByType image/jpeg "access plus 1 year"
 ExpiresByType image/gif "access plus 1 year"
 ExpiresByType image/png "access plus 1 year"
 ExpiresByType image/x-icon "access plus 1 year"
 ExpiresByType text/css "access plus 1 month"
 ExpiresByType text/x-javascript "access plus 1 month"
 ExpiresByType text/js "access plus 1 month"
 ExpiresByType text/css "access plus 1 month"
 ExpiresByType application/x-javascript "access plus 1 year"
 ExpiresByType application/js "access plus 1 year"
 ExpiresByType application/javascript "access plus 1 year"
 ExpiresByType application/pdf "access plus 1 month"
 ExpiresByType application/x-shockwave-flash "access plus 1 month"
 </IfModule>

<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
 </IfModule>

# Set rules for Gzip stuff and more efficient headers
 <IfModule mod_deflate.c>
  <IfModule mod_headers.c>
  Header append Vary User-Agent env=!dont-vary
  <FilesMatch "\.(js|css|xml|gz)$">
  Header append Vary: Accept-Encoding
  Header set Cache-Control "max-age=2592000, public"
  </FilesMatch>
  </IfModule>
  AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
  <IfModule mod_mime.c>
  # DEFLATE by extension
  AddOutputFilter DEFLATE js css htm html xml
  </IfModule>
  # 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
 </IfModule>

#4 – Ensure you Nginx is Configured correctly for things like Gzip:

Within Plesk go to “Apache & nginx Settings” for the domain in question and ensure it looks like this:

Here is the code:

gzip on;
 gzip_static on;
 gzip_disable "MSIE [1-6].(?!.*SV1)";
 gzip_vary on;
 gzip_proxied any;
 gzip_comp_level 1;
 gzip_buffers 16 8k;
 gzip_http_version 1.1;
 gzip_proxied expired no-cache no-store private auth;
 gzip_min_length 10240;
 gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml application/x-font-ttf font/opentype text/html te$;

location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|pdf|ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|eot|exe|flv|htm|html|img|iso|js|mkv|mp3|mpeg|mpg|ppt|pptx|qt|rar|rm|swf|tar|tgz|ttf|txt|wav|woff|woff2|xls|xlsx|zip)$ {
  expires 30d;
  add_header Pragma public;
  add_header Cache-Control "public";
  access_log off;
  try_files $uri @fallback;
 }

#5 – Use PHP 7.x (if you can)

With modern hosting platforms you should be able to switch versions of PHP with ease. We offer PHP 7.x on all of our shared hosting servers. Some clients have reported as much as a 20% reduction in page load times by making this simple change. This is how you do it with us:

Within Plesk, Navigate to your “Website & Domains” area, then click on the “PHP Settings” Icon:

Screen Shot 2016-05-30 at 8.45.24 AM

Then select PHP 7.x from the drop down menu and then click the “Apply” button at the bottom of the page.
Screen Shot 2016-05-30 at 8.50.31 AM

#6 – Use WP Smush

This is a great little Plugin and the free version is very good! it reduces large image files that cuts down all the unnecessary data without slowing down your site.

#7 – Use CloudFlare Pro!

If you have never seen it in action CloudFlare Pro will blow you away in how well it will speed up your site (as well as protect it!). The basic version of CloudFlare is great but the pro version comes with several technologies that are designed to dramatically speed up your site. More info here.

#8 – Choose your hosting provider & products wisely

There are some very tell tale differences between cheap web hosting vs good web hosting out there. You don’t need to break the bank but you do need to choose wisely to ensure that you are getting good value for your money these days. In addition depending on how your site is used and you plan to scale there are many great hosting products suited for the job as can be seen here in this WordPress hosting comparison chart.