Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

Thanks

share|improve this question

migrated from stackoverflow.com Dec 26 '10 at 3:46

This question came from our site for professional and enthusiast programmers.

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

5 Answers 5

up vote 11 down vote accepted

Does validating boost my results?

No.

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.

share|improve this answer
    
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.

share|improve this answer
    
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.

http://www.youtube.com/watch?v=FPBACTS-tyg

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

share|improve this answer

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

share|improve this answer
    
This is pragmatism! –  Ryan Li Dec 25 '10 at 17:40
    
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  ionFish Sep 5 '12 at 21:20

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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