How to Validate Your Website Design and Fix Common Coding Errors
- 1 Comment
Most sites have many errors or incorrect code in their web design. Should you fix these errors? What are the most common errors when building website pages? What affect can these errors have on your search listings?
- Lower search listing results - the amount of errors is factored in how a search engines algorithm ranks your site
- Errors can make spiders visit less often
- Web design coding errors can make sites get totally deindexed - if you don’t care about your sites code why should search engines care? they have thousands of other sites to choose from
- Errors can make you site not show properly in browsers
- Not all code is compatible in all browsers
- Errors can stop spiders from being able to crawl your entire site, some pages may not be able to be found
- Some errors have no ill effect on your sites ability to be indexed, even Googles main page has validation errors
- Deindexed.com had 56 errors and 13 warnings on the main page, I have fixed many of the errors today and now the site has only 5 more errors to fix
How to check your code for errors
W3 is the current standard for coding web pages. They offer a free validation service at W3 Validator, validator.w3.org. Just type in the url of the page you want to check and they will quickly check your code and show you where the error exists and how to fix the errors. In the blog roll on the bottom left of this site you may notice a link to w3 that I leave on many of my sites to check my sites code often. Right click on it and choose properties and you will see the refer code used for the link that will open a page that shows any errors from the page that was click thru from. Example link: W3 Validation link for this page.
Common coding errors and how to fix them
I am assuming your code will be written in php, most blogs use php, html is different. HTML does not use a trailing slash for closing img tags, meta tags. HTML tags that have a closing tag are mostly unchanged. Valid php code is written in all lower case. Some editors included with some content management systems will by default make all your tags uppercase and make it difficult for your pages to validate.
1. the line break code does not have a trailing slash. the line break code <br> should be written as <br/>
2. Not using alt tags in your images. You can just keep the alt tag empty if you have a reason or always use some descriptive text for the image.
An empty alt tage looks like alt=”" or you can use alt=”any descriptive text here”
3. Common Error: not added a closing slash at the end of an img tag.
wrong code example
<img src=”urltoimage.gif”>
corrected code example
<img src=”urltoimage.gif” alt=”picture title” />
The corrected code has the alt tag included and the trailing slash to close the image tag, closing tags of this type when coding php pages is required when designing pages using php.
4. All tags that do not have a closing tag must use the trailing slash, this includes meta tags. The title tag has an opening and a closing tag.
example:
<title>Title of your site</title>
The title tag is closed with the slash in the closing tag.
Meta tags error example:
<meta name=”description” content=”seo web design”>
corrected meta tag:
<meta name=”description” content=”seo web design.”/>
notice the extra slash.
5. all tags that do not have a closing tag need the slash at the end “>” needs to be coded as “/>”
6. When you must use a dynamic link that has the &, the ampersand, in the url please change it. Use the correct character code , you can find a nice list of character codes here Character Codes. The page says html character codes but they work and are correct for php coding also.
I will be adding a validation service for correcting website coding problems in the next few days. Feel free to drop me an email using our contact form with any questions or pages you are having trouble fixing and I may check your site and offer a fix.
Related Articles:
1 Comments on this post
Trackbacks
-
Valid XHTML 1.1 said:
The main page of deindexed.com is now error free and XHTML 1.1 compliant, November 7 2008. The IE6 and IE7 browsers do show an error, “error does not support this property”. I have seen this error on another site I validated, its the search form that uses a call to javascript. I’ll change it and the pages error should disappear.
November 7th, 2008 at 10:22 pm

