I have a dynamic php website which index only has around 800 errors according to the w3 validator online.

I have tried checking major websites like ebay, stackoverflow and others also, all with around 400 errors.

So my first thought is, what good is that validator when it always displays errors?

Secondly, will the errors affect my SERP ranking? ie, will me fixing these errors as good as I can increase my Google search position?


  • 2
    stackoverflow valid for HTML 4.01 Strict! – haha Dec 25 '10 at 17:28
  • Check out the Google SEO Starter Guide. Just follow the advice in it and you should be OK. Also, how dare you say that SO has 400 errors! :) – Šime Vidas Dec 25 '10 at 18:52
  • Inbound links are the only major factor in determining rank. – danlefree Dec 26 '10 at 5:49
  • I disagree, domain name and page title seem to carry an awful lot of weight themselves. – John Conde Dec 26 '10 at 16:07

Does validating boost my results?


what good is that validator when it always displays errors?

It does not always display errors. It displays errors where there are errors. Which leads to what your question should have been, that is:

Does writing horrible, invalid HTML do me harm?

And... Yes. It does you harm because you'll have lots of browser incompatibilities; because nobody that ever hired me for front-end would hire you; because it's likely to break DOM-related processing; because your accessibility will suck and will cut off a good 2% of the human population; because rankings aren't handicapped by lack of validity per se, but are surely helped by a meaningful, orderly code.

Not over yet: it's not only bad for you, it's bad for all of us and we should blame you. Because nice web services you use daily rely on standards, and if their development is slow and they can't reach their potentials it's because of you, sloppy markupper.

Every day, when you wake up and realise the web is not the perfectly architectured network of semantic relationships that it should be already, you will have give us all your apologies.

Also happy holidays.

  • wow, selected? you sure can accept criticism, @Camran. also, @people-who-voted-this-down: arguments? – cbrandolino Dec 25 '10 at 19:00

So my first thought is, what good is that validator when it always displays errors?

Great question! The validator checks the markup syntax against the W3C specification, which these days is either HTML or XHTML. It is perfect (or near-perfect, although I haven't found any major errors in its checking) in the sense that it will tell you that you have technically invalid markup.

Nevertheless, invalid markup in practice is not game over. Think of W3C standards as a very strict specification of a specific dialect of English. When a browser is developed with the specifications in mind, think of it as going to a school in that dialect, leaning the proper way to speak, read, listen to, and comprehend this dialect of English. In practice, this browser also goes out to the playground and travels the world and learns to understand slight modifications on the standard convention. The browser also watches old movies, so it learns how to understand "older" syntax and vocabulary, even though it wasn't strictly taught in school (in the specification). Some browsers (most notably IE <9) had parents (developers) who felt that the regular curriculum could be revised to make a better browser, so they got sent to a completely different private school. At the end of the day, you get different browsers understanding different languages. Each of them also have very generous "fudge" factors. Just like you know what someone means when they slur their speech or include typos, browsers do the same. Even more often, people or communities devise innovative ways to speak (write markup) that browsers happen to understand despite not having been formally trained it in in school (under the specification). At that point, you get a lot of non-standards compliant code that still works in practice.

Secondly, will the errors affect my SERP ranking? ie, will me fixing these errors as good as I can increase my Google search position?

Google recommends compliant markup, but there is almost no conclusive evidence one way or another aside from cases where experimenters mangle their markup so severely that the content doesn't even display properly. This is likely because Google's own crawler is versed not only in the standard specification, but also in all of the dialects including those casual and old. It also had a lot of fudge-compensating mechanisms to make up for small "mistakes".

At the end of the day, try your hardest to have valid markup if you can. It is entirely possible to do so if you make it a priority. In my experience, by the time that you're advanced enough to break the rules (which I know I am not), you know enough about the rules and the parsing and display implications that your original question isn't a question at all.

  • There aren't different dialects of HTML4. There are different versions of HTML and XHTML, but the reason why people use invalid markup is because they either don't know it's invalid or specific browsers didn't allow valid markup (not because they're more cultured, but because the developers screwed up). Programming languages aren't the same as human languages. Their rules of grammar and syntax aren't subjective. For the web to function properly, developers have to follow rules implemented by browsers; and browsers have to follow the specifications set out by the W3C. – Lèse majesté Dec 26 '10 at 4:24

It won't affect your SERP rankings. From the official YouTube channel for Google Webmaster Central:

And so we don't give any sort of boost to pages if they validate. It may be a nice thing to do for your own internal purposes, but it doesn't get any sort of Google boosting in your rank or anything like that. And the simple reason is that the vast majority of pages on the web don't validate as it is right now.


It is still a good idea to validate your page though, as it will make the code less error prone and easier to maintain.


Most SEO’s seem to agree that having code that isn’t properly nested or has big errors is bad for SEO. They all agree too that it’s not going to get you any better rankings when you really have valid HTML.

My final conclusion thus is: both for web design & SEO reasons, you’ll want to fix any and all blatant errors that might cause bad rendering or parser issues. Don’t worry about attributes that are not allowed though, nor about that one plugin using tags instead of . It’s just not worth your time or money.

- W3C Validation: why you should care, and why not at yoast.com

  • This is pragmatism! – Ryan Li Dec 25 '10 at 17:40

It isn't a factor at all. HTML is very flexible language, there is no problem with doing something like this

< ul >
 < li >< a xtooltip='Go to homepage' href='index.php' >Home< /a >< /li >
< /ul >

Then you just use your favorite javascript engine and have nice menu with tooltips. Of course it won't validate.

The other thing is that W3C validator is broken unfortunately. It can't validate content-type, js code, js code html output, ajax, to name a few. Besides not checking content-type is a serious flaw. If you have XHTML DOCTYPE but content-type: text/html you should validate against HTML, most people will validate (incorrectly) against XHTML and then fix "errors"... like changing

[br] => [br /]

but [br /] is an error in HTML... so they do what validator incorrectly tells them to, and all they do is adding bugs to their code.

  • The W3C validator's purpose is not to validate your Javascript. That doesn't make it "broken". – richsage Dec 25 '10 at 18:50
  • document.write("<div this is my div content</div>"); All i'm trying to say - you should not depend on it too much before you know EXACTLY what the result is and what it isn't. Eg. user-defined attribute according to spec isn't really an error. Maybe broken isn't the correct word but i think you know what i mean... it usually flags completely correct code as having "errors", and fails to get eg. content-type and JS HTML generated bugs. – Slawek Dec 25 '10 at 18:59
  • Yes, true :-) In that case it would be prudent to validate the final output of your page (eg view generated source), rather than the page pre-JS rendering. – richsage Dec 25 '10 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.