Last updated on

What is a Language Code?

The language code tells visitors the natural human language of the web page content. Many tools and applications use the language code to apply correct fonts and styling, use a different voice with text-to-speech applications, determine the spell checking dictionary to use, and other tasks that depend on what the language of the page is.

How to Declare Language?

To declare a language, HTML uses the “lang” attribute. The “lang” attribute can be added to any HTML tag, but in most cases it should be added to the top-level <html> tag if all of the content on the web page is in the same language. Here is an example of how the <html> element will look with the “lang” attribute set to English: <html lang=”en”>.

 

SIGNUP FOR

BOLDGRID CENTRAL  

   200+ Design Templates + 1 Kick-ass SuperTheme
   6 WordPress Plugins + 2 Essential Services

Everything you need to build and manage WordPress websites in one Central place.

2 thoughts on “Declare the Language Code for the Page

  1. Hi,

    Where does the code go? I have the header and footer plug-in installed for my website, can I put the code in the header?

    Thanks.

    • Hi John,

      The language attribute applied to the element that wraps all of the content on your website is automatically added by WordPress and it uses the same language setting configured in your WordPress dashboard. You can find the language settings for your website by navigating to Settings > General in your dashboard and then selecting the language you want from the Site Language drop down. After saving your changed WordPress will automatically update that attribute to use the new language setting.

      Please let us know if you have any other questions!

Leave a Reply

Your email address will not be published. Required fields are marked *