13 Oct 2008 @ 6:12 PM 

Let’s not beat around the bush.
One missing tag can cause several validation errors.

A few small tweaks to your existing code can produce great benefits from search engines.
You don’t need to make every page meet HTML 4.1 Strict conditions, but I think XHTML 1.0 Transitional is suitable. Some times you will have to forfeit valid code for functionality or appearance.

This tutorial covers some of the more common validation errors, and how to avoid them.

Search Engine Optimization and Valid Code

Search engines love valid code. It’s faster to crawl, easier to index and improves SERPs relevancy.

It’s a good idea to validate your page after creating or making changes to see if there are any major problems. This simple check can help in many ways:

  • Tag spell checker
  • Find invalid code
  • Find unclosed/unopened tags
  • Find badly nested tags
  • Prevent scripts crashing

You can Validate You Web Pages using these links:

So what did make our site different? Why would it rank so fast during the time of the Google “sandbox”? I had to ask myself: Is it content? Doubtful, as the site had less than ten pages. Was it links? No, the site had none as it was only 12 hours old. Was it domain age? Maybe partially as the domain had been purchased about five years earlier, but this would not explain why the site ranked in the top 10 for some main keywords. So what could it be? Am I just an SEO rock star that did not know it? Of course not! So I thought and thought and I developed a theory about these sites quick rise to the top: code matters! Still, I had to wait until the launch of my latest site to prove it to my befuddled brain.

If Content Is King – Valid code is it’s pince! is a great SEO article, which is very relevant to this post.

Common Validation Mistakes

There are some things which get made priority over others. For example: Getting a web site up and running can often mean forgetting to target, or even add, alt tags for each image used.
My experience has been, these small errors build up. Before you know it, you have 150 validation errors!

150 validation errors could mean only 10 mistakes. So don’t get too worried if there seems to be a lot when you validate your code.

Below is a list of common HTML validation errors:

Deprecated HTML tags

Older HTML tags and attributes that have been superseded by other more functional or flexible alternatives (whether as HTML or as CSS ) are declared as deprecated in HTML4 by the W3C – the consortium that sets the HTML standards. Browsers should continue to support deprecated tags and attributes, but eventually these tags are likely to become obsolete and so future support cannot be guaranteed.

These are a few common tags, which should be avoided:

<center>
<font> 
<strike>
<u>
<applet>
<basefont> 
<dir> 
<isindex> 
<menu> 
<s>

Missing alt tags

Every image should have an ‘alt tag‘. This helps to increase keyword relevancy and crawlability by image searching services.
Even if the tag is blank, it’s best to have one in place. It’s easy to be tempted to fill every image with the same keywords in an attempt to spam. I don’t think it would make much difference and prefer to think the variety in keywords is a better way to use the space.

It’s also worth remembering that if the picture can’t be found, the alt tag will be displayed instead of the picture. So try to keep it appropriate and short if it’s a small picture!

Examples of good use of the alt tag:

<img src="wp-images/header.gif" alt="Abe On Tech News Blog" />
<img src="wp-images/button.jpg" alt="Tech Button" />
<img src="wp-images/spacer.gif" alt="" />

Escape slashing single tags

There are some tags which are singular and don’t require a closing tag. These should have a / added before the closing bracket.
Below are a few example tags:

<img src="http://www.abeontech.com/wp-images/header.gif" alt="logo" />
<br />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<input type="hidden" name="user" value="007" />

Incorrect tag nesting

Some tags are required to be placed within other tags to be displayed correctly.
Below are a few example tags which should be placed in div tags…

<p>
<strong>
<a>

Unclosed tags

Keeping track of how many tags you have open can help prevent multiple errors for one mistake.
A common error is having nested or generated div tags, but leaving one or more open.
This is easy to spot when validating the page.

Closing Notes

Iin my opinion, it’s best to try to keep as many pages valid as possible. It’s good practice to remember the tags needed and validate the code during or after any changes (even small ones, as spelling mistakes can be overlooked!).

As mentioned before, it’s nearly impossible to keep every line of code valid to html 4.1 strict standards. Just consider the benefits and drawbacks before using non-valid code.

If you’re not sure where the validation error is, start from the top. Validate the page and fix the top error. Re-validate the page and more errors will have disappeared. Rinse and repeat as required.



  • Technorati
  • StumbleUpon
  • Reddit
  • del.icio.us
  • Facebook
  • MySpace
  • LinkedIn
  • Live
  • Sphinn
  • MisterWong
  • Slashdot
  • Tumblr
  • Wikio
  • Yahoo! Buzz
  • BlinkList
  • Google Bookmarks
  • Print
  • email
Posted By: Abe
Last Edit: 11 Dec 2009 @ 10:32 AM

EmailPermalink
Tags


 

Responses to this post » (2 Total)

 
  1. Georgette says:

    Georgette…

    great post…I look forward to reading more! thanks alot!…

  2. jgoto says:

    You are absolutely right about alt tags. They really do seem to help. My Opinion is Google seems to like alt tags. Also it’s important for accessibility purposes.

Post a Comment

You must be logged in to post a comment.

Change Theme...
  • Users » 195
  • Posts/Pages » 37
  • Comments » 28
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

DDO Forum



    No Child Pages.

Login



    No Child Pages.