Quick Guide to Optimizing your WordPress Website
View CommentsSpeed is a very important factor when trying to rank higher in search engines , every 10th of a second counts. Google, Yahoo, Bing etc take the time in which a website or web page loads very seriously, if you have a slow website then you are loosing tons of visitors even though your site’s content is what people all over the world search. Here are the things you must do so your website will become significantly faster:
How to do all those things:
1. Opimize Images
You can quickly optimize your images without loosing any quallity by using a plugin called: WP Smush.it Just access your Media Library and you will see a new tab called “Smush.it” hit Smush.it now! and the image will be optimized. Wp Smush.it removes meta data from images and compresses them making them much smaller but without any quality loss.
Browser Caching or Leverage Browser Caching tells browsers to keep images (or css and javascript) stored on their local storage device untill you say so and when that browser revisites your website it will load those images from local storage and thus loading your website much faster.
To enable Browser Caching all you need to do is add the following code to your .htaccess located on your website root by using a FTP client.
1
2
3
4
| <FilesMatch "\.(jpg|jpeg|gif|png|js|css)$"> Header unset Etag Header set Cache-control "public, max-age=604800" </FilesMatch> |
The time the browser will keep loading those files from local storage rather than downloading them from your website is given by the max-age “command”. You can change that to whatever you want, the current value of 604800 means 1 week in seconds. 1 week is recommanded to be used.
3. Enable Compression
Enabeling compression for your website allows the server to compress HTML before sending it to the browser, this makes the size of files sent from the server to the browser much smaller.
To enable compression just copy this code to your .htaccess file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| <IfModule mod_gzip.c> mod_gzip_on yes mod_gzip_dechunk yes mod_gzip_keep_workfiles No mod_gzip_temp_dir /tmp mod_gzip_minimum_file_size 1002 mod_gzip_maximum_file_size 1000000 mod_gzip_maximum_inmem_size 1000000 mod_gzip_item_include file \.htm$ mod_gzip_item_include file \.html$ mod_gzip_item_include file \.php$ mod_gzip_item_include file \.css$ mod_gzip_item_include mime ^text/.* mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\[" </IfModule> <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/css application/x-javascript text/plain text/xml image/x-icon </IfModule> |
4. Minify CSS, Javascript and HTML
Minfiying means removing all whitespaces thus removing a few bytes off the files.
To Minify CSS, Javascript and HTML simply install WP Minify The plugin will automatically minify all your css, javascript and html files. You can adjust settings at the Tools panel in WordPress Dashboard. You are done optimizing your WordPress website, you may wanna check the results by using Google’s Page Speed, to do this check out a previous post of mine: Using Firebug and Google Page Speed to Optimize your Website.
Tags:
Wordpress