I’ve a project were I can only add code beneath the <html>
-tag but it’s important that the language is in the header for SEO and some other stuff.
So my question is:
What is the priority/ranking of
<html lang="de-DE">
vs
<meta http-equiv="language" content="DE">
2
Answers
From HTML5 the
meta http-equiv="Language"
is obsolete. You should better use the<html lang="de-DE">
attribute.Refer this:For HTML, should we put language declarations in HTTP headers and meta elements, and how are they different from those in language attributes?:
The specification about Content-Language tells that:
According to Google Multi-regional guidelines:
so from an SEO point of view it shouldn’t matter. It’s actually more important to put the language in the URL:
Given that the meta tag is obsolete (see Rahul Tripathi’s answer) and you can’t add the html 5 equivalent. I simply wouldn’t bother.
If your site is multilingual then you should consider implementing
hreflang
tags to redirect users of the languages you wish to target to the correct language page.See google docs here