This Blog Is Not For Reading

A blog, just like any blog, only more so

Invalid HTML considered harmful

Posted by Bob Jonkman on April 28th, 2009

Screenshop of HTML Dog Web SiteValid HTML is not just useful for browsers. One of the big benefits of having valid HTML is that search engines can properly index your site. If the HTML is invalid, then the search engines may index you incorrectly, or not at all. Google isn’t the only search engine out there, and you want to drive as much traffic to your site as possible.

There appears to be some contention whether valid HTML makes a difference to search engines or not. Some say it doesn’t; or that it depends on the search engine; others have evidence it matters a lot.

Even if you’re not coding by hand, I urge you to have a look at HTML Dog, a set of tutorials on creating valid HTML. When things don’t work as expected you can turn here for examples in XHTML.

Favicon - HTML Doghttp://htmldog.com/

If you’re going to be using an editor for your Web pages, pick an editor that creates proper HTML code. Abandon FrontPage. I suggest using KompoZer, which is based on the same rendering engine as Firefox (Gecko).

Favicon - Kompozer.nethttp://www.kompozer.net/

You should also be checking your pages in Opera, which is a browser that is even better for standards-compliance than FireFox. The Chief Technology Officer for Opera is the same guy that wrote the Cascading Style Sheets specification, so it has a good pedigree.

Favicon - Opera.comhttp://opera.com

If you’re using Firefox then be sure to check your pages with the HTML Validator addon:

Favicon - Skynet.behttp://users.skynet.be/mgueury/mozilla/

Screenshot - HTML ValidatorAnd when you think your site is done, check each page with the full-strength validator:

Favicon - W3C HTML Validatorhttp://validator.w3.org/

Favicon - CSS Validation Servicehttp://jigsaw.w3.org/css-validator/

<heavy sigh… />

–Bob.

5 Responses to “Invalid HTML considered harmful”

  1. Stephen Paul Weber Says:

    Ironically, this page does not validate.

  2. Bob Says:

    I know it. And I’m not happy about it.

    This is a WordPress blog, which is oodles better than the Blogspot blog I used to use. But, as you point out it’s not perfect either.

    I’m not sure if the invalid HTML comes as a result of the templates or themes I’m using, or if the WordPress code itself is sloppy. Certainly the editor is terrible. I compose the posts with the non-WYSIWYG editor, but it won’t let me insert certain types of markup. For example, I tried to put in a URL with the tel: URI scheme, but the editor won’t accept that. <a href=”tel:+1-519-635-9413″> has the “tel:” stripped out. Listen, WordPress, I’m editing the code, and you should do what I tell you to.

    Sigh. Thanx for your sympathies.

    –Bob.

  3. Stephen Paul Weber Says:

    The bug is probably mostly in your theme. I run WordPress at my site, and generate fully well-formed XHTML as well as mostly-valid XHTML5 (I output some legacy meta tags that HTML5 hates, I also use the rev=”" attribute which I do not believe should have been removed, and my use of ins and del tags is often just day-level granularity on datetime=”")

    Are you using the vanilla theme? I could probably help you fix it up :)

    About the inserting tel: links : do you have the WYSIWYG editor off completely, or are you using the “code” tab on it? Turning it off is much safer.

    I also use http://wordpress.org/extend/plugins/x-valid/ to make sure that commentors cannot insert markup that breaks my well-formedness.

  4. webdesign Says:

    Thanks for the info. The topic This Blog Is Not For Reading » Blog Archive » Invalid HTML considered harmful was just what I was looking for. Will bookmark!

  5. This Blog Is Not For Reading » Blog Archive » Four things to improve your search result rankings Says:

    [...] the page up high. That counts for all search engines, not just Google. I’ve written about this in Invalid HTML Considered Harmful. There are consultants that can help you correct invalid HTML; you may know one or two [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


9 + 7 =

 
Better Tag Cloud