Meta Tags – Apparently Order Matters


Meta tags are as old as the web itself. Being the original means in which search engines functioned. They have managed to hang around and are still important in search engine optimization today. Who knew that the order in which meta tags appear in the HTML documents really mattered. Well the W3C HTML validation tools along with many SEO firms have shown that order does matter.

In SEO it is apparent that meta tags should be present immediately after the title tag, this everyone who has touched SEO knows. Bruce Clay's tools for onsite SEO and analysis revealed that the description tag should precede the keyword tag. Whether this is a matter of unnecessary technicality remains to be researched.

Far more interestingly, the W3C HTML validation tools kept reporting errors while trying to validate The website is written in HTML 5 so this may be a glitch in the experimental validation process; however, after some digging it became clear that the content type meta tag necessarily had to follow the title tag, but can be above or below the description and keyword meta tags. Placing the content-type tag after any other header information results in a validation error that accuses you of changing the encoding which would "[require] non-stream able behaviour". Logically this makes perfect sense since the type of document should be stated prior to any content.

This is a new validation error since it does not appear in HTML 4.1, or XHTML 1 or 1.1 doctypes. So to comply, at least for now, with both the W3C standards and the known SEO approach your document structure for the first few lines should be as follows remembering, for now at least, the placement of the content-type meta can be above or below the other 2:

After than it's up to you what order your tags go in. It's worth pointing out that HTML 5 does not require self closing tags to have / s in them. Furthermore, it seemed logical to start using HTML 5, although it is not spec, because Google now uses HTML 5 and XHTML is not supposed to be transmitted as text / html, but that is another article.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.