Any idea why this is not generating an html5 doctype in my pages?

<apex:page applyBodyTag="false" applyHtmlTag="false" showHeader="false" 
  cache="false" contentType="text/html" sidebar="false" 
  standardStylesheets="false" docType="html-5.0">

API version is set to 36.0. When I open the console in IE11, I get this warning message:

HTML1527: DOCTYPE expected. Consider adding a valid HTML5 doctype: "".

Also, when I view the page's source in Chrome, Firefox, and IE11, I do not see a <!doctyle html> tag included in the markup.

  • 2
    what is your vf page api version? It has to be above API version 28.0! Jan 4, 2019 at 17:54
  • 1
    Can you share us your findings on how did you identify that page is not generating Html5 doctype? Jan 4, 2019 at 18:15
  • Please edit your post with any clarifications.
    – Adrian Larson
    Jan 4, 2019 at 18:22

1 Answer 1


Adding a "custom" contentType appears to suppress the DOCTYPE. Do not add this attribute if you need the DOCTYPE.

<apex:page applyBodyTag="false" applyHtmlTag="false" 
           showHeader="false" cache="false" sidebar="false"
           standardStylesheets="false" docType="html-5.0">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.