0Wordpress LogoThe WordPress Guide

Part 3: Growing & Making Money

3.1 Performance

Keep your site fast — both humans and search engines don’t like wait­ing

3.1.1 Minimise plugins

Through­out this art­icle we’ve recom­men­ded lots of plu­gins.  They’re all valu­able and can add to your site.  How­ever, don’t go over the top.  Each and every plu­gin that changes your site appear­ance adds pro­cessing and trans­fer over­heads.  Plu­gins that are for man­age­ment use only (e.g. backup plu­gins) are of much less issue.  Wherever pos­sible, use a theme which includes the func­tion­al­ity, or imple­ment solu­tions without plu­gins, for example, instead of using the “extern­al links” plu­gin to apply style your extern­al links, simply imple­ment this styl­ing your­self with a bit of CSS and an image or 2.  Try to keep a sens­ible bal­ance — don’t remove valu­able plu­gins just to keep the num­ber of plu­gins low, but don’t keep ones you don’t really need either.

3.1.2 Remove unused plugins

This is simple — if you’re not using a plu­gin then don’t waste host­ing space on them.  Unless you think you might want to react­iv­ate a plu­gin in the future don’t just deac­tiv­ate, but delete.  Remov­ing unneeded plu­gins also keeps your word­press man­age­ment page less cluttered.

3.1.3 Replace plugins

Some plu­gins are very large and have a lot of fea­tures, but you might only use one fea­ture of such a huge plu­gin.  Con­sider manu­ally adding the code for that fea­ture and ditch­ing the over­head of the whole plu­gin (see sec­tion 3.1.1) or con­sider find­ing an altern­at­ive plu­gin which offers just the fea­tures that you need.

3.1.4 Cache & Minify

Word­Press is based on PHP and MySQL, and both of these require sig­ni­fic­ant pro­cessing whenev­er a page is accessed.  Since neither users nor search engines like wait­ing for pages to load you should reduce load times by util­ising vari­ous cach­ing and effi­ciency plu­gins.  Cach­ing gen­er­ates stat­ic HTML files for each of your pages, redu­cing the delay caused by your web serv­er pro­cessing PHP and access­ing the data­base.  Mini­fy­ing removes redund­ancy from your CSS and JavaS­cript.  The 2 lead­ing solu­tions are W3 Total Cache, which does both cach­ing and mini­fy­ing or a com­bin­a­tion of WP Super Cache and WP Mini­fy.

3.1.5 Compression

Your host­ing will almost cer­tainly be run­ning on either the Microsoft of the Apache web serv­er.  Our host uses Apache, which sup­ports com­pres­sion of any data it sends, if you choose to enable it.  The Microsoft web serv­er also sup­ports com­pres­sion which can simply be turned on or off.  All mod­ern web browsers sup­port com­pres­sion.  There are 2 ways of com­pres­sion data with Apache, and you may only want to com­press cer­tain files.  Here at DIYMH we com­press all our text based files using apache’s mod_deflate.  This reduces our front page load size from approx 100k to approx 20k!  Depend­ing on your web host you may only be able to enable some types of com­pres­sion.  Better­Ex­plained have an excel­lent guide to com­pres­sion which we recom­mend you read.

3.1.5 Keep scripts in files

All non con­tent really should be in extern­al files, not loaded inline. This speeds up browser ren­der­ing sig­ni­fic­antly and also makes debug­ging any page errors easi­er.  JavaS­cript should be in js files, Styl­ing should be in CSS files etc.  Even some meta con­tent can go in extern­al files (for example see sec­tions 1.4.3 and 1.4.17).  Word­Press is very good at keep­ing to this, but if you make modi­fic­a­tions try to stick to the sys­tem.  Some word­press plu­gins are bet­ter than oth­ers at this, so if some aren’t up to scratch, con­sider find­ing an altern­at­ive.

3.1.6 Use CSS Sprites

CSS sprites are an excel­lent way to reduce the num­ber of HTTP requests sent back and forth between the read­ers browser and your web serv­er.  Instead of hav­ing 30 indi­vidu­al images, which all have to be reques­ted sep­ar­ately, you can reduce the num­ber of requests to the serv­er by hav­ing all of images in a single file.  Use CSS to insert the cor­rect part of the image each time you want to use it.   Anoth­er bene­fit is that 1 large image file is often smal­ler than sev­er­al small images com­bined.  There is more inform­a­tion at CSSTricks, W3Schools and Smash­ing­Ma­gas­ine

3.1.7 Compress images

By default lots of images can be losslessly com­pressed bet­ter than word­press does by default.  This will save on image trans­fer times.  There are plu­gins that will do this for you, e.g. WP Smush.it.  If you’re using PNGs (as recom­men­ded in sec­tion 2.1.2) then there are sev­er­al ways to improve effi­ciency.  To max­im­ise PNG effi­ciency images can be com­pressed with PNG­Gaunt­let, how­ever this must be done after upload.  If the image doesn’t con­tain many shades or col­ours then save it as a 256-col­our image — this will reduce the file-size sig­ni­fic­antly, but again, this effi­ciency should be sought after upload.  The reas­on for not com­press­ing or redu­cing the col­our depth of images before upload is that the PHP res­ize func­tion will not cre­ate good qual­ity res­ized images if they are already com­pressed.  So, upload your images, let word­press gen­er­ated the res­ized images, down­load them with an FTP pro­gram, com­press them with PNG­Gaunt­let, and then reup­load and over-write the ori­gin­als.  WP Smush.it will get you 90% of the way and is much more con­veni­ent. We always recom­press our PNGs loc­ally with PNG­Gaunt­let, but you may not want the hassle — the choice is yours.

3.1.8 Set expiration of static resources

Browsers cache all the con­tent that they load.  To avoid images and oth­er stat­ic resources being reloaded on every page load you can spe­cify an expiry time which instructs the browser to use its cached copy until the expiry date passes, when it will fetch a fresh copy.  Any­thing that doesn’t change very often should have an expiry set.  At DIYMH we do this via W3 Total Cache.

3.1.9 Use relative links

If you insert any links to any­thing else on your site always use a rel­at­ive path, rather than a full path. This saves a tiny bit of page size, but more import­antly, it means you won’t have to change them if you ever change your domain name.

3.1.10 Remove old revisions

By default word­press retains a copy of all pre­vi­ous revi­sions of every art­icle on your site.  This is overkill in our view.  The easi­est way to man­age this is to use a plu­gin, e.g. revi­sion con­trol, which will auto­mat­ic­ally cull older revi­sions based on your set­tings.  This will keep your data­base size down and the speed of your site will bene­fit.

3.1.11 Check your page speed

Whilst google page speed (see sec­tion 1.3.2) is a good place to start, we recom­mend using a wide range of tools to check you’ve optim­ised your site fully.

Please send us your thoughts by commenting below! If you would like to subscribe please use the subscribe link on the menu at the top right. You can also share this with your friends by using the social links below. Cheers.

You might also like...

Leave a Reply