I need to change my DOCTYPE to HTML5 from <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

This is a requirement of Google in order to be approved as a Google Trusted Store.

Can anyone advise how I do this and if there are any downsides to it?


You need to change the doctype in the following files:

  • app/design/frontend/<your_package>/<your_theme/page/1column.phtml
  • app/design/frontend/<your_package>/<your_theme/page/2columns-left.phtml
  • app/design/frontend/<your_package>/<your_theme/page/2columns-right.phtml
  • app/design/frontend/<your_package>/<your_theme/page/3columns.phtml
  • app/design/frontend/<your_package>/<your_theme/page/empty.phtml
  • app/design/frontend/<your_package>/<your_theme/page/popup.phtml
  • app/design/frontend/<your_package>/<your_theme/page/print.phtml

In those files, replace the following line at the top of the file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<!DOCTYPE html>

Regarding any downside, I'm afraid this is not Magento related so I suggest you check this very good StackOverflow post regarding reasons not to start using html 5 doctype

| improve this answer | |
  • Thanks. Are there any downsides or potential adverse effects in doing this Raphel? – Jimnibob Jun 9 '16 at 13:15
  • @Jimnibob see my updated answer – Raphael at Digital Pianism Jun 9 '16 at 13:17
  • 1
    Anyone looking for a Magento 2 solution, override app/design/frontend/<your_package>/<your_theme/templates/root.phtml from magento-theme/view/base/templates/root.phtml to edit the doctype – Luuk Skeur Mar 13 '18 at 10:31

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.