What is Doctype?
DOCTYPE is a declaration at the beginning of an HTML document that specifies the version of HTML or XHTML that the document is written in.
In HTML5, the doctype declaration is simply:
This declaration tells the web browser that the document is written in HTML5 and that it should be rendered according to the HTML5 specifications.
In earlier versions of HTML, the doctype declaration was more complex, specifying the document type definition (DTD) to be used. For example, the doctype declaration for HTML 4.01 Transitional was:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
The doctype declaration is an important part of an HTML document because it ensures that the document is rendered correctly in different web browsers.
How to fix have doctype declared in Shopify?
As you can see in the below image the Html Code starts with <html. It means there is no doctype declared before starting the HTML file
Here are the steps to fix the missing doctype for the Shopify store.
Step 1:- Open Your Shopify Dashboard
Step 2:- Search for theme.liquid in the theme search box
Step 3:- Paste the given code above the <html file
Like this And then save the file
Once you have saved the file Check the Source Code of your website to Verify.
As you can see in the below image the Doctype is clearly visible for the store.
Also Check:- Guide: How to create robots.txt file Shopify
If you are still facing any issues drop us an email on firstname.lastname@example.org