Top 5 most common validation errors
January 26th, 2010 by Richard
W3C Validation errors are errors in the coding of a web page, they can range from missing alt tags, right through to unclosed, or incorrectly nested tags.
A Search Engine spider is basically a piece of software that visits a website, and expects to find it in a certain format and layout, so each time it finds one of these validation errors it has to decide what should be there. This all takes time, and the spiders only have a finite amount of time to crawl and index a page. If this time elapses before the page is completely indexed then this will cause problems in rankings.
Here are the five most common validation errors we encounter, and how to fix them.
No DocTypes
A doctype tells the browser what form of HTML you are using, for example HTML 4.0, XHTML or HTML 5. This impacts how the rest of the code is expected to be read, affecting the parsing ergo the way it is displayed in the browsers.
A list of doctypes is available from the World Wide Web Consortium (W3C) website (http://www.w3.org/QA/2002/04/valid-dtd-list.html). Place the correct doctype at the top of the webpage, above the opening html tag.
Closing tags
Tags that are either not closed or are mismatched cause a lot of problems. When using html tags, they should be closed in the order that they are opened, for exampled:
<div>some <b>bold</b> and <i>italic</i> text</div>
not
<div> some <b>bold and <i>italic</b></i> text</div>
When using xhtml, tags that don’t have a partner closing tag (for example the image tag) should be self closing, i.e. should have a forward-slash before the end of the tag, for example
<img src=”file.jpg” alt=”a file” />. Another example is the line break tag (<br> for html and <br/> for xhtml).
HTML in JavaScript
You would not believe how often this happens. Mostly it’s people trying to prevent spiders getting their email addresses in order to stop spam email. They will use something along the lines of:
<script type=”text/javascript”>
document.write ‘<a href=”mailto:”+”info”+”@”+”domain.com”>Email</a>’
</script>
The problem here is the closing anchor tag. Closing tags are recognised so need to be escaped, whereas comments and opening tags are not recognised. There are two approaches to fix this; either comment out of the javascript (by putting <!– after the first line, and –> before the last line), or put a leading back-slash before the forward-slash (</a>).
Missing Attributes
A common example of a missing attribute is “alt” in the img tag. An easy fix, just include alt=””, for example <img src=”image.jpg” alt=””/>, but even this should be avoided. Wherever possible include a description in the alt tags, and wherever possible, include a keyword. This will help search engines determine what the image is about, and may include it under their respective images search, creating another possible source of traffic.
Flash
This is the most common problem with websites that use flash. The <embed> tag was created by Netscape as their method of embedding plug ins and players in web pages. As it is not part of the XHTML specification it needs fixing. There are a couple of fixes – one is to use javascript to write the embed code, or use the fully valid object code:
<object data=”flashmoviename.swf” type=”application/x-shockwave-flash” width=”504″ height=”250″>
<param name=”MOVIE” value=”flashmoviename.swf” />
</object>
Any additional parameters can be included in using the param tag within the object tags.
We, at SEO Consult, understand that having a fully validated website is of huge benefit to your SEO campaign as it allows spiders to work out what your pages are about by being able to remove the content from the html tags easily, without having to guess at the correct html in order to make sense of the content.
Link to us
If you want to link to this blog, copy and paste the following HTML code to your website.









