SEO says doctype not declared

Vvel
Explorer
73 2 9

In my liquid.themes files its been there as shown below. Why isn't it declared?

-----‐-----------

{% render 'breadcrumbs' %}
{% capture content %}
<!DOCTYPE html>
<html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="{{ shop.locale }}"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="{{ shop.locale }}"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="{{ shop.locale }}"> <![endif]-->
<!--[if IE 9 ]><html class="ie ie9" lang="{{ shop.locale }}"> <![endif]-->
<!--[if (gte IE 10)|!(IE)]><!--><html lang="{{ shop.locale }}"> <!--<![endif]-->
<head>

0 Likes
KieranR
Shopify Partner
214 19 53

Where are you seeing this warning? Check what's getting output in view-source HTML.

Full time Shopify SEO guy, based in NZ. Sometimes freelance outside the 9-5.
0 Likes
Vvel
Explorer
73 2 9

https://prnt.sc/126twcu

And its from SEM Rush report

0 Likes
KieranR
Shopify Partner
214 19 53

So SEMrush audit/report only looks at static content. View-source & inspect element are different in Chrome. First is static content, second is rendered DOM. 

KieranR_0-1619993461485.png

^screenshot is of view-source.

It looks like you have two tags: 

  1. <!DOCTYPE html> 
  2. <html>

I'm guessing that SEMrush is just flagging (2). Ideally you would only have a single opening tag so not sure what's happening there, but try cleaning that up.

Also not related but somehow there is some JSON-LD which has been added outside of the <html> tag. More correct to place this within the head or body.

Full time Shopify SEO guy, based in NZ. Sometimes freelance outside the 9-5.
0 Likes
Vvel
Explorer
73 2 9

Ok ill put those script under the doctype.

For the 2nd html, that was added after the seo report. I thought you were supposed to have it as this https://www.w3schools.com/tags/tag_doctype.asp

 

0 Likes
KieranR
Shopify Partner
214 19 53

Just trying to guess what is tripping up SEMrush because their docs are not super clear: 

KieranR_0-1620016923717.png

But it looks like you have doctype dec correct anyway, so I wouldn't worry too much about what SEMrush is saying there. Maybe try reach out to SEMrush support out of curiosity if you wanna find out how they are parsing it and flagging a warning.

 

Full time Shopify SEO guy, based in NZ. Sometimes freelance outside the 9-5.
0 Likes