Forum Moderators: open

Message Too Old, No Replies

How Important is the Doctype?

         

Swebbie

3:57 pm on Oct 3, 2005 (gmt 0)

10+ Year Member



I read this in a SitePro News newsletter today. Does anyone know if it's accurate and worth the time to fix on every web page that doesn't have it currently (over 1000)?

Through research, we determined this was a compliancy issue (losing pages in Google's index). By having compliant code, the search engine spiders are more easily able to spider the content.

The solution? Make sure you use a DOCTYPE tag and an ISO Character Set Statement at the top of every Web page.

For example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.1 Transitional//EN">

<META HTTP-EQUIV=content-type CONTENT="text/html; charset=ISO-8859-1">

SEOMike

4:10 pm on Oct 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not having a Doctype will prevent a page from validating. Validated HTML is important for search engine indexing. Browsers are forgiving when it comes to displaying pages with "unclean" HTML (unclosed tags, no quotation marks, etc.) however, search engine spiders are not so forgiving. Even something as simple as a missing quotation mark on the <.a href="page.html"> can cause a spider to not index text or a link. Ensuring that your HTML validates will prevent errors when the spiders come to index. I would recommend using the tool located at: [validator.w3.org...] for validating your HTML. Google's bot is probably pretty forgiving because most of the pages on the net don't validate correctly. Even so, why guess? Just make it validate.

encyclo

4:10 pm on Oct 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We had a recent discussion about this very topic:

[webmasterworld.com...]

It is not the presence of a doctype per se that will help, but the absence of markup errors confirmed by the validation process. Incidentally, the doctype listed above is incorrect, so you should use one of the doctypes listed here:

[w3.org...]

If you are unsure, you should choose the doctype for HTML 4.01 Transitional:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Declaring a character encoding (charset) is equally vital, especially if you are using a non-English language for your documents (but even for English is it important). The exact charset depends on the document language - ISO-8859-1 is a common encoding for many western European languages (English, French, etc.).