WordPress Site Language

Change HTML Language In WordPress

HTML Language value is a declaration of which language you are using for the website. If you go to your WordPress website page source you will see the default settings is <htmllang=”en-US” >.


If you are using different language for your website, you may need to change this value. But if you don’t, it’s not a big deal. Google ignore this value. But for the best practice, you can change it from your website’s dashboard. Go to Settings>General and change the Site Language, and then click Save Changes.

WordPress Site Language

If your desired language is available in the list, WordPress will install it automatically after you click Save Changes. All done! Now refresh your page and check the source code. You will see that the value has changed.

The Other Way

The above method is great. But it will change the language of the dashboard too. If you want to change the html language value for your website but you want to keep your dashboard in English, then copy and paste following code in your theme’s functions.php

add_filter('language_attributes', 'custom_lang_attr');
function custom_lang_attr() {
  return 'lang="bn-BD"';

Change bn-BD to your language.

Spread the love

A teacher by profession, a traveler by passion and a netizen by choice.

Morshed Alam

You use WordPress! Why don't we share our experience! It may be a tutorial, tips, tricks or about security, performance or WordPress news. Write Today

Leave a Comment

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