1

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?

1 Answer 1

4

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">

With:

<!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

3
  • Thanks. Are there any downsides or potential adverse effects in doing this Raphel?
    – user38658
    Commented Jun 9, 2016 at 13:15
  • @Jimnibob see my updated answer Commented Jun 9, 2016 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
    Commented Mar 13, 2018 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.