Bad Nested Code Could Hurt Your SE Rankings

Tweet

codeThere are two main situations when bad code can hurt a site’s rankings: when publishers make changes to already existing sites, and when sites are developed from the start carelessly.

Some sites (usually blogs), may stop doing well in search, commonly after minor site adjustments like: adding new widgets, plugins or rich-media files. These additions could break the code, making it impossible for search engines to crawl the site.

Sites that are developed from the start with special features like JavaScript, cookies, session IDs, frames, DHTML, or Flash may never perform well Not because the search engines cannot read such pages, but because some are simply not coded correctly. Optimizing bad coded sites for search is time consuming and costly. If you plan a new site make sure you ask the developers to pay special attention to the code, and make sure that all of the pages appear correctly in different browsers.

The easiest way to avoid any such problems is to develop sites that respect Google’s guidelines for Flash and rich media, and Google’s technical guidelines.

Some special tips for WordPress users:

As I already mentioned, adding widgets and plugins could change page code, or even break it, and the result is almost always lower performance in search engines.

A plugin known to cause problems is What Would Seth Godin Do (WWSGD). This plugin adds a text that encourages new visitors to a blog to sign up as an RSS subscriber. If you set the plugin to add this welcome message before the first paragraph of a blog entry, its text might be the only thing Google indexes as the “description” of the page it appears on. The plugin deactivates the welcome text after a certain number of returning visits, but Google’s crawler will be seen by the plugin every time as a new visitor, so you will end up with a series of articles indexed by Google like this:

google-indexing

Google’s bot is smart enough to read the rest of the text and the site gets indexed, but the search engine ranking will be mediocre at best. If you must have WWSGD on your site, try to add it after the body text of the article.

Sometimes plugins crush the MySQL database (WP Super Cache and Comments Relish have known issues); if your blog remains unavailable for too long (usually a few days) it may be completely de-indexed. Luckily most WP users are able to find resolutions to such problems in due time. For less savvy users, a word of advice: less is more. Don’t add too many widgets, badges, scripts or plugins.

The most dangerous instances, however, are generated by scripts already existent in customizable WP themes; for example scripts that add a tag cloud on every page. Each tag is a link and the more links you have on a page, the lesser its “link juice” value. Some tag clouds display only a limited number of tags to the user, but if you open the “page source” to see the code you can sometimes see a clutter of hundreds of tags. This clutter creates pages that are too big, load extremely slowly and can cause crawl problems.

For news publishers (indexed by Google News), these crawl problems appear as “article too long” or “article fragmented” and “page too large” (pages can only be 256KB long) and lead to total de-indexing. Other publishers are not affected, but their SE rankings remain low (a possible solution is to install a plugin that adds rel=”nofollow” to tags). A known theme that can generate such problems is WP Magazine (click on any article title on the demo site and look at the source code).

I hope these few examples give you an idea of how important good coding is for a site’s SE success. If you know of any other instances when bad nested code hurts website publishers and search engine rankings, please let us know.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • tedgoas

    Amen! It’s always distressing to see WordPress themes that boast all these neat features to non-developer types. I’ve been bitten by this a few times now and always wonder what’s going on under the hood of themes loaded with plugins and widgets.

  • http://www.baymard.com jamieappleseed

    This is one of the reasons to code your website from scratch (granted you have the skills of course) – to get super clean code which SE spiders can just slurp up like chicken soup.

    Re: WSGWD-plugin, you’ll want to put it at the end of your posts anyways. It’s not just better for search, it also makes the most sense, since someone who is new to your blog wouldn’t just subscribe to your feed before having read one (or more) of your articles.

  • biswa

    To rank a webpage google use 200+ algorithm .This is one of them ,If your site is not well formatted then not an issue , if other factor is strong. This does not means that if you make your site well formatted then google will rank you well. This is only one of them. I have lot’s of example. But I personally recommended to use well formatted code, this helps in both search engine crawl + multi browser display. When create a page use a validation tool if this tool gives you a green signal, then rock .
    http://validator.w3.org/#validate_by_uri

  • tinjaw

    Interesting point I hadn’t really thought of yet as I am only just now worrying about search ranking. I think I need to audit my code.

  • Chris

    From my understanding google still ignores all html and does not care at all if it’s proper nested or valid. Did they change this i cannot see it in the article?

  • http://www.ewriting.pamil-visions.com/ Mihaela Lica

    @Chris – Google never ignored html – please follow the links in the article that lead to Google’s tech. guidelines about this, and you will understand better.

  • AK

    Just used the Lynx browser and it’s horrible. Mihaela if a client asks me to make the site complaint with this browser, how do i check if it’s compliant? Do I just make sure the links are viewable?

    That’s it, right? Also, feel like this kind of information should have stayed in the closet and not out in the open.

  • http://www.pamil-visions.net/ Mihaela Lica

    Hi Ak, I think you will find a few answers here http://www.anybrowser.org/campaign/abdesign3.html – as for the information staying in the closet, I have to disagree. Anything we can do to make a site better should be open. :)

  • Sue

    Thanks for adding more knowledge to my ever-expanding mental reference. The article’s fluidity needs improvement though.

  • Stevie D

    @chris:

    From my understanding google still ignores all html and does not care at all if it’s proper nested or valid. Did they change this i cannot see it in the article?

    Google isn’t bothered about valid code. What Google is bothered about is making sense of your page content. And to do that, Google does read the HTML – it does look at headings, tabular relationships, strong and emphasised text, acronyms and abbreviations – and it does eventually get bored and stop reading a page if it goes on too long. If you use semantically valid code, you’re going to make it easier for Google to accurately figure out what your page is about; if you use invalid or semantically inappropriate code, Google is less likely to interpret your page correctly. If you use lean and mean code, Google will get to the end of the page without breaking a sweat. If you fill your page – especially the beginning – with loads of scripts and widgets and styling, masses of presentational code, intricately nested tables and other such cruft, you’re increasing the risk that Google struggles, huffing and puffing, through all this rubbish only to run out of steam and give up before getting to the meat of the page, which won’t then be indexed.

  • Stevie D

    @AK:

    Just used the Lynx browser and it’s horrible. Mihaela if a client asks me to make the site complaint with this browser, how do i check if it’s compliant? Do I just make sure the links are viewable?

    Lynx will distinguish between text, headings and strong/emphasised text. It will show bulleted and numbered lists. It will show alt/fallback text for images and other rich media. It will allow you to see how your site functions without styles or scripts.

    No, your website won’t be a thing of beauty in Lynx, that isn’t what Lynx is about. But if you can figure out what the page is about, by the headings and other marked text, if you can read the pages and navigate around the site (while pretending to be a visitor to the site who doesn’t know all this to start with) then you’re probably OK. If you can’t do that, the chances are that search engines and people using assistive technology can’t either.

    That’s it, right? Also, feel like this kind of information should have stayed in the closet and not out in the open.

    That’s kind of tricky given that lots of us have known this for years ;-)
    When there is good information, it’s best to share it. Otherwise we’ll live in a world where it is forever IE6…

  • al_mar

    Thanks for information, Niche post, I Like This.
    Pasang Iklan Gratis
    bisnis pulsa

  • topfan

    Hi

    I believe there are more than that so nesting could only hurt your SEO where I would say it would hurt your site http://www.matchmate.ca

  • sadiamansoor

    nice informative article , specially very helpful for beginner. keep it up!!

    http://www.tucknoloji.com

  • goldcoinsgain

    Hi this is very interesting and this is very impressed by me.gold bullion