Answers Search Help
Boston University home page
Google: Optimizing Your Site
 
 
    Search Engines
 
 
 
 
 
    Good Content
 
 
 
 
 
    Good Code
 
 
 
 
 
 
 
    Bad Practices
 
 
 
    Additional Benefits
 
    Supplementary
 
 
 
    Sample Pages
 

Clean and Valid Code

Search engines won't be able to index your site if they can't read it. Clean code is free of unnecessary code and meets HTML specifications. Valid code has been validated against the HTML specifications. To clean up and validate your code, use Dreamweaver's report tools or submit your site to the W3C's validation service. Once your code validates, you can be certain the search engine spiders will be able to read it.

Let's say, for example, that you forget to close the opening tag of a paragraph, so your code looks something like this:

<p<img src="jellyfish2.jpg" class="right" align="right" alt="photograph of several jellyfish" title="photograph of several jellyfish">Jellyfish (also called jellies or sea jellies as they are not true fish) are animals that belong to Phylum <a href="Cnidaria">cnidaria.html</a>, included in the class Scyphozoa. Almost all jellyfish live in the seas...</p>

When the search engine spider reads your this code without the closing bracket for the opening paragraph tag, it may assume that all of the text in the paragraph is attribute information for the paragraph tag and will ignore it. If you have search terms and useful outgoing links in this paragraph, you've just lost an opportunity to boost your ranking in the search results.

Validation Errors

For his master's thesis, Dagfinn Parnas studied 2.4 million web pages for validation errors and found that more than 99% of them could not validate according to the W3C's standards. The most common validation errors he found included:

  1. The page is missing a Document Type Definition (DTD) declaration.
  2. A tag is missing a required attribute.
  3. A tag contains a non-standard attribute.
  4. A tag was opened but not closed.
  5. A tag was closed but never opened.

In addition to watching out for the above errors, you should also be aware of the following rules when writing good code:

Broken Links

Other errors on your page can also limit how search engine spiders index your site. Broken links are dead ends for spiders. Search engine spiders index text and follow links. If they come to your site and encounter broken links, they won't be able to fully crawl your site and they may abandon it (they've got the whole Internet to index, why waste time with a site with broken links!).

To test your site for broken links, use Dreamweaver's link checker or the W3C's link checker.

 

WebCentral Using Publishing Learning Training Consulting WebCentral
Answers Search Help
NIS  |  OIT  |  Boston University  |   February 5, 2007