Results 1 to 8 of 8
  1. #1
    Full Member ahmar's Avatar
    Join Date
    January 17th, 2005
    Please can someone explain how important is it to declare the DOCTYPE at the top of each html page?
    <DT>[size=1][color=navy]"The best measure of a man's honesty isn't his income tax return.[/color][/size]<DT>[size=1][color=navy]It's the zero adjust on his bathroom scale." Arthur C. Clark[/color][/size]</DT>

  2. #2
    Join Date
    January 17th, 2005
    Mount Pleasant, WI
    Obviously any browser will adapt to an html page without the DOCTYPE declaration. However the "correct" way is to include it on the first line of every page.

    So why do it? There is a theory that some search engines rank pages that validate properly slighter higher. Without the DOCTYPE declaration, your pages will never validate properly.

    For more info on it, read


  3. #3
    ABW Ambassador cditty's Avatar
    Join Date
    January 17th, 2005
    Memphis TN
    I have also run across some JS code that will not run unless the doctype is there. As strange as it is, the missing doctype prevented the JS from running.
    Recycled Talent - Architects of custom scripts and snippets, perfectly written to suit any need. We stay on top of the latest technology so you don't have to.
    Total Stupidity - Shining light on stupid things.

  4. #4
    Affiliate Miester my2cents's Avatar
    Join Date
    January 18th, 2005
    far far away....
    Yesterday in Michael Campbell's newsletter Internet Marketing Secrets Newsletter #68, he wrote the following...


    Up to 27% more pages in the search engines

    Are you losing web pages in the search engines. Is your
    positioning going down. Are newer sites coming up ahead of
    you? Here's something that may surprise you as being the
    reason why.

    Very quietly on December 15th 2004, the world wide
    web's official "governing body" posted new architecture
    guidelines. You can read the full paper at the web
    site, but after spending the better part of a day "down the
    rabbit hole" I can tell you what's in there.

    The web is evolving. So is the technology. Old "legacy" html
    code just doesn't cut it anymore and has been officially
    declared invalid.

    Ever since the 4.01 Specification W3C recommendation in late
    1999, web page authors were supposed to be putting a DTD,
    document type declaration at the beginning of their html code.

    According to W3, "HTML 4.01 specifies three DTDs (Strict,
    Frameset, Transitional), so authors must include one of the
    following document type declarations in their documents."
    Notice the strong wording, "must include."

    Few people did and it took a long time before html software
    and wysiwyg editors began inserting the code. The W3
    stressed, yo dudes... "The document type declaration is
    mandatory at the beginning of each HTML document." Notice
    they've gone from "must" to "mandatory."

    In case you're wondering, the DTD is the first line of your
    html document and should look similar to this:

    !DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01

    In addition to the DTD, we're supposed to add character
    encoding. Which conforms to the "Universal Character Set
    (UCS), defined in ISO 10646. This standard defines a
    repertoire of thousands of characters used by communities
    all over the world."

    Commonly used character encodings on the Web include
    ISO-8859-1, ISO-8859-5, SHIFT_JIS, EUC-JP and UTF-8. But
    it doesn't matter which one you use as, "This specification
    does not mandate which character encodings a user agent
    must support."

    However, "Conforming user agents must correctly map to ISO
    10646 all characters in any character encodings that they
    recognize (or they must behave as if they did)."

    So in other words, you need a character encoding or Charset.
    You can use any one you want 8859-1, UTF-8, whatever, so
    long as it conforms and correctly maps to the IOS 10646
    standard. (Both 8859-1 and UTF-8 do.)

    Hmm, I thought I'd do a little investigating: uses...
    meta http-equiv="Content-Type" content="text/html;

    Google uses...
    meta http-equiv="content-type" content="text/html;

    So what was I using on my web pages? Turns out that every
    web page I created in since January 2004 follows the rules.
    But before that, it starts to fall apart. I did not include
    a valid Charset. And I didn't have a DTD in any article, web
    page or newsletter I wrote prior to July 2002 when I switched
    to Mozilla as my html editor.

    Turns out, not only was I missing "mandatory" elements,
    a lot of the html code generated by PageMill, FrontPage,
    HomePage and other editors I'd used over the years was
    literally trash. How do I know? I used the's own
    validation service.

    ( If you want to clean and upgrade your code, here's the
    f r e e url to push button validate your pages: )

    Without the Charset in my html page, here are the results
    I received when I first ran the Validator on my pages:

    "It is necessary to have this (Charset) declaration before
    the page can be declared to be valid. I was not able to
    extract a character encoding labeling from any of the valid
    sources for such information. Without encoding information
    it is impossible to reliably validate the document. I'm
    falling back to the "UTF-8" encoding and will attempt to
    perform the validation, but this is likely to fail for all
    non-trivial documents."

    Simply put... without a Charset the web page is declared
    officially "invalid." Very spooky indeed.

    If you're like me and have been writing articles,
    newsletters and making web pages for several years, chances
    are you've got a whole lot of "legacy" documents that are no
    longer valid... but how would the search engines behave if I
    did update and validate my html.

    You guessed it! I decided to set up a little experiment. I
    started adding the DTD and Charset to some of my old web
    pages. Ones that have been around for couple of years.

    Let's fire up the most compliant html editor Mozilla,
    which you can download for f r e e at Here is the
    code it inserts in every new html document. (Please note for
    this example, to prevent my text from turning into an html
    document, I took out the usual coding brackets <> and
    replaced them with - dashes - .)

    !DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
    meta content="text/html; charset=ISO-8859-1"
    -title- spicy title goes here -/title-

    Turns out that 78% of the pages I validated and updated got
    respidered. Of those that got respidered, 27% of them stuck
    in the index, and my position in the SERPs (search engine
    results pages) went up an average of 5 - 8%. Woo Hoo!

    Then while on the phone with my friend Leslie Rohde (who -
    being a spider programmer - knows more about search engines
    than just about anyone else) asked if we had a control set
    where we just changed the content but didn't add the DTD
    and Charset?

    Without it, how would we know if the pages were getting
    spidered because the modification date had changed as
    opposed to adding the compliance codes. (Leslie reminded me
    that spiders always check the modification date, no change
    usually means the pages won't get respidered.)

    Doh! Back to the drawing board... or at least I thought.
    Wait a minute, the experiment failed due to the lack of a
    control piece, but the data is very relevant.

    Adding the DTD and Charset achieved several things...

    1) It gave my pages the mandatory html code
    2) By making a change, the modification date changed
    3) Making the change = 78% more spidering activity
    4) 27% more pages ended up in the index as a result
    5) More pages in the index = increased saturation
    6) More saturation focuses more PR and link pop
    7) More PR and link pop increases position in SERPs
    8) Better SERPs = better chance to be found
    9) First to get found, first chance to make the sale
    10) Sales have gone up as a result

    So to know for sure, which changes affected the results,
    I'd have to set up another experiment... this time with a
    control piece. But I'm ecstatic about the results. Any time
    I can go from 100 to 127 pages in the index, just by adding
    a snippet of code, and move up five spots in the SERPs to
    boot, I'm a happy camper.

    All you need to do, is verify your code using the push
    button validator at the web site. Who knows, by doing
    so, you could end up with more pages spidered and indexed
    and increase your overall search engine positioning.

    this is sure give many of us many restless nites...

    that's my2cents, 'cuz I'm a legend in my own mind....

  5. #5
    Content $ Queen Ebudae's Avatar
    Join Date
    January 18th, 2005
    Ok - here is what is one my pages:

    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1

    Is that ok? Also, it is not at the top of the page but at the very bottom of the head. So, does it need to move to the top? And does it go in the "head tag" or above the "HTML" tag?


  6. #6
    Full Member ahmar's Avatar
    Join Date
    January 17th, 2005
    Quote Originally Posted by Ebudae
    Ok - here is what is one my pages:

    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1

    Is that ok?
    After Joe posted the link, thanks Joe, I read about it in depth at What I have read till now that seems to be OK as long as it stays within <head></head> tag. And DOCTYPE at the top of everything.

    You can also confirm it by "Validating" your page at the through their validator (see Joe's post). If it gives you warning that no charset detected and UTF8 is used instead to validate your page then it means there is something wrong. If doesnt give you any message then you are fine.
    <DT>[size=1][color=navy]"The best measure of a man's honesty isn't his income tax return.[/color][/size]<DT>[size=1][color=navy]It's the zero adjust on his bathroom scale." Arthur C. Clark[/color][/size]</DT>

  7. #7
    Moderator MichaelColey's Avatar
    Join Date
    January 18th, 2005
    Mansfield, TX
    I ran through the validator and it found dozens of "errors". The first one was that there was no DOCTYPE. If Google can leave it out, I bet it's safe for me to leave it out, too.

  8. #8
    Action Jackson - King of the World
    Join Date
    January 18th, 2005
    I can't validate my site at all. I even tried doing it by address and no luck.

  9. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. DOCTYPE and CSS
    By Doug247 in forum Midnight Cafe'
    Replies: 2
    Last Post: June 24th, 2009, 11:12 PM
  2. Adding Doctype in InstrumentPro template
    By shilmy in forum Scripts
    Replies: 5
    Last Post: July 8th, 2007, 11:11 AM
  3. Dyse: DOCTYPE and Server Too Busy
    By djblade311 in forum Scripts
    Replies: 1
    Last Post: August 9th, 2006, 07:15 PM
  4. How to include Doctype in the default.html
    By jimbo717 in forum Scripts
    Replies: 2
    Last Post: October 31st, 2004, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts