1

I understand that the doctype at the very start of any page has this attribute:

<html lang="en-US">

This is obviously language-specific.

What I am wondering is, rather than create multiple pages for different languages, can I just simply add this HTML attribute:

<p lang="hi">नमस्ते</p>

"hi" is the language code for the Hindi language.

So, is my approach a good one? I just need a paragraph in Hindi, that's all. 90% of the HTML doc is in English - but just wondering about the correct "SEO" for that.

  • <html> is not a doctype. This is: <!DOCTYPE html> – Rob Apr 15 at 11:25
0

Yes according to the World Wide Web Consortium (W3C) documentation you can include the main language for your document and declare another language for a specific element of the page. Here is the documentation. So the example you gave would be correct.

<html lang="en-US">

<p lang="hi">नमस्ते</p>

However, if you have SEO in mind and want to rank that page for Hindi-speaking users, you might have problems to rank high as other competing pages might have better signals (title of the page, headers, internal links, external links) to rank for those Hindi terms.

| improve this answer | |
0

You are saying that you just need a paragraph in Hindi, that's all. Then creating multiple (or just one) pages for different languages would be the wrong way to go. Adding your one (or many) paragraph and marking it through the lang attribute, is the right way and it will not impact negatively on SEO.

| improve this answer | |
0

Googlebot ignores the lang= attribute in HTML. It is fine to use it, and the W3C recommends it, but it won't do anything for SEO.

Google automatically identifies the languages used in your pages based on the words. You don't need any special markup to tell Google about which languages you use.

You should not mix two languages in the same page if at all possible. Google recommends creating separate URLs for content in separate languages. Mixed language pages are generally not good for users because it requires that your users understand both languages, and not that many users are bilingual.

A paragraph in another language could be OK if that paragraph were then translated or explained in the page in English, or if you are sure that almost all your users can read both languages.

| improve this answer | |

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.