Does html code layout affect SEO?

Discussion in 'Search Engine Optimization' started by Kerosene, Oct 17, 2007.

  1. #1
    Simple question...

    Do search engines care if your html/xhtml/whatever is 'correctly' formatted?
    e.g Line breaks here, indents there etc...

    Or does it make no difference if it's all just one big long line of code (as long as it's valid)?
     
    Kerosene, Oct 17, 2007 IP
  2. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #2
    it does matter..
    The only rule is it should be w3 validated... Error free coding with good meta tags :)
     
    MeetHere, Oct 17, 2007 IP
  3. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #3

    Huh?
    It does matter? Or the only rule that matters is that it needs to be w3c valid?

    And if it's all W3C valid (which everyone's code should be!), then is it all ok to have one big long line of code?
     
    Kerosene, Oct 17, 2007 IP
  4. sweetfunny

    sweetfunny Banned

    Messages:
    5,743
    Likes Received:
    467
    Best Answers:
    0
    Trophy Points:
    0
    #4
    A good code to content ratio is also excellent practice, by not having bloated code you keep your page sizes and load times down which is good for both Google and the visitor.
     
    sweetfunny, Oct 17, 2007 IP
  5. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #5
    Sorry its should be "doesn't matter" ;)
     
    MeetHere, Oct 17, 2007 IP
  6. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #6
    Aha! :D

    That's good. Cause I've just deleted all the line breaks and tabs from my code in a neatness frenzy :p
     
    Kerosene, Oct 17, 2007 IP
  7. sweetfunny

    sweetfunny Banned

    Messages:
    5,743
    Likes Received:
    467
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Removing Whitespace doesn't matter, actually it's good because you are reducing your page size.
     
    sweetfunny, Oct 17, 2007 IP
  8. the1982smith

    the1982smith Guest

    Messages:
    9
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    White space within the code doesn't matter, however it will increase the page size which in turn increases the load time which could possibly have an seo impact, but it's unlikely.

    One thing worth noting is that removing the white space makes it very awkward to work with the code in the future.

    In terms of code optimisation: The W3C validation is rumoured to help (never actually seen any evidence that proves a page without errors ranks higher than a page with) and bringing the relevant content higher up the code using CSS helps. E.G move the navigational elements etc lower down the code so Google sees the <h1> first and then the juicy content, then the duplicate content seen on all pages like navigation last.

    Adding relevant keywords to comments is also thought to help. Try also adding keywords to any HTML labels you can.

    HTH
     
    the1982smith, Oct 17, 2007 IP
  9. renderman

    renderman Peon

    Messages:
    56
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Yes, from my experience i can say: "valid xHTML/CSS based sites are more likely to get indexed by google." That is also one of the reasons the gridparking.com system in my sig creates xHTML valid pages with unique css namings for each domain.. and it works great:)
     
    renderman, Oct 17, 2007 IP
  10. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #10
    It won't matter one iota if your code looks about as spotless as a military barracks or as messy as a pig sty - the search engine spider will still crawl through the page looking for content to index.

    It also doesn't matter if the code is valid or not, or uses 100% semantic HTML instead of layout tables (if that were the case, then none of the popular sites would have been indexed back in 1996, and the "SEO industry" would never have "taken off" in the first place), though the proper use of semantic markup can affect how well a search engine indexes your content.

    There are however, indirect benefits - not only will having valid well formatted code help reduce the time it takes for the user agent (read: browser) to download and render the page, but it can also improve the usability and accessibility of the Web page in question if it's done properly (by that I mean user agents such as screen readers won't have to guess what the meaning of a particular piece of content is, such as a header or emphasized text for example).

    As for removing the formatting from the Web page, that can actually hinder the readability of the page when another coder has to take over responsibilities for the care and maintenance of the page/site in question. Or if you come back six months later and start scratching your head wondering "what the heck was I thinking back then?"

    Now, do you remember what I said earlier about how semantic markup can affect how your content is indexed? It works like this. A Web page is best compared to a newspaper article. Don't laugh - trust me on this for a minute (you can laugh when you're done reading this if you still feel the urge). Just as a newspaper article has a title, so does the Web page (the masthead for the newspaper can be compared to the masthead for a Web site, which I use an IMG element for instead of a H1 heading - and here's why). So to represent the "article title" I'll use a H1 heading for the page title. I'll then follow that H1 with a paragraph or two (if a content page - if it's an eCommerce type page, I'll use the most appropriate element to provide the overview of the product in question, which ironically in most cases would still be a paragraph) to provide an overview of what the page is about.

    From there, I'll use H2 elements to identify the major sections of the Web page's content (and by content I mean the stuff the person reads - what they came for in the first place, not the menu, blog categories, sidebars and whatnot). I'll also have some paragraphs that are associated with these headings (since that's what the headings do - identify what the content that's coming up will be about). I'll do the same thing for H3-H6 elements as needed, but only as needed.

    Ever notice how a newspaper article will have one gigantic heading (the H1), but will always have at least two "subheadings" in a certain order (h2, h3, h3, h2, h2, h3, h3, h4, h4 for example) that don't skip each other? It's kinda like an outline, and you should do the same thing with your Web copy (and who thought those English classes in school were good only for an hour long nap? - come on, show some hands here).

    The search engines will be affected by this kind of markup since they can use the HTML elements to identify the relationships between text content in headings and paragraphs, as well as elements that have some emphasis (em) and strong emphasis (strong). Obviously in ases where you want to identify a ship's name you'd italicize the text (I), such as USS Kitty Hawk.

    And now I'm going to wrap this up with something I don't think was originally touched in this thread - overall page layout. Many people will say to have your content come before your menu "because it's good for SEO" - that's not necessarily true. Search engines can index a lot of content on a page - and if you need to the content come first on your page, chances are pretty good that you have so much content that it needs to be re-written (people don't like reading long blocks of text on a computer screen if they can help it; my post is no exception). Besides, if that's not possible, then leave the menu before the content anyway - granted, 85% of your large pages may only get indexed if you do, but at least you can take comfort in knowing that 100% of your pages were indexed even if they were not indexed completely. :)
     
    Dan Schulz, Oct 17, 2007 IP
    login likes this.
  11. dcristo

    dcristo Illustrious Member

    Messages:
    19,796
    Likes Received:
    1,201
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    5
    #11
    Google basically looks at the content and ignores the rest. The HTML coding purists may disagree.

    You have too much time on your hands :)
     
    dcristo, Oct 17, 2007 IP
  12. Webdrops

    Webdrops Peon

    Messages:
    106
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    As far as I know it does not matter... but proper line indentation helps us manage our site...
     
    Webdrops, Oct 17, 2007 IP
  13. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #13
    html coding doesn't matter as long its readable by Google.
     
    inworx, Oct 17, 2007 IP
  14. Cheap SEO Services

    Cheap SEO Services <------DoFollow Backlinks

    Messages:
    16,664
    Likes Received:
    1,318
    Best Answers:
    0
    Trophy Points:
    0
    #14
    It does matter if it is messy and long. Googlebot has been known to leave a page early due to bad coding.
     
    Cheap SEO Services, Oct 17, 2007 IP
  15. Brian Melony

    Brian Melony Guest

    Messages:
    60
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #15
    It should be W3 validated ...
     
    Brian Melony, Oct 18, 2007 IP
  16. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Sigh... how many times do I have to say this? A search engine doens't care if your HTML is valid or not - it's not the HTML grammar police afterall. Its job is simple - to find and index CONTENT.

    Yes, you should validate your code, yes you should format it properly, and yes you should make sure you use as little code as possible, keeping all scripts and styles in external files, but a search engine spider won't care one way or another if you do or not. All that will happen is that it'll take LONGER to find and index the content, and you'll probably lose the benefits of semantic markup (proper use of HTML elements) since there will be no "meaning" in the first place.
     
    Dan Schulz, Oct 18, 2007 IP
  17. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #17
    Very good Dan.

    Everybody listen to Dan plaease.
     
    login, Oct 18, 2007 IP
  18. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #18
    That results in Search Engine Positioning..
     
    inworx, Oct 20, 2007 IP