Learning

How to Declare the Language of Your Website via HTML?

Aside other options and internal codes, you should also switch your focus on Language. Curious why it should be among your website settings priorities and how t

Start readingBrowse the library
Declare the Language of Your Website via HTML
TopicLearning
Reading time2 minutes
ContentMaintained by GeoRanker
GeoRanker field noteAside other options and internal codes, you should also switch your focus on Language. Curious why it should be among your website settings priorities and how t

Practical research for teams working with search visibility, SERP data and public-web intelligence.

Intelligence LibraryLearning

Aside other options and internal codes, you should also switch your focus on Language. Curious why it should be among your website settings priorities and how to declare your language? Let’s start with the basics.

Why You Should Declare the Language of Your Website

First off, assuming you have already bought a domain and a hosting service pack for 1+ years, the next step is to decide in which language your website is going to be. For local domain extensions, you should focus on your local language, which is also healthy for the search engine optimization of your page. For international, you should use a language that is spoken frequently: English. You would want to focus on a specific language for

targeting reasons, for traffic, business exposure or personal.

How to Declare the Language via HTML

While users can understand what language is primary on your website with just one click, search engines function based on algorithms and data. Therefore, you would need to “speak its own language” and that is HTML. To assist search engines and browsers, the lang (language) attribute can be used to declare the language of a web page or a portion of a web page. For example, the following sets the default language to English:

html5 language declaration

In XHTML, use both the lang attribute and the xml:lang attribute together every time you want to set the language. Make sure that the values for both attributes are identical.

xhtml language declaration

Use Language Codes from ISO 639-1.

We hope you found this useful. Check back for more short tutorials for a better web experience!

From insight to infrastructure

Need the live search data behind the analysis?

Use GeoRanker APIs for location-accurate SERPs, Maps, Images, YouTube and public-web data.

Explore the data APIs