How to change the language HTML attribute to a different language

How to change the language HTML attribute to a different language

The default language attribute (lang) is English (en). If you are creating a website using ExploreMyPC in another language you might want to change the HTML language declaration to your preferred language. Here is how to do it:

You'll use our Code Injection feature that lets you inject scripts in the header (or footer) of your website.

Step 1. Copy the following code


<script>
const html = document.querySelector("html");
if (html) {
html.setAttribute("lang", "es");
}
</script>


Where "es" is the language parameter. You'll need to change that to your preferred language. Find all the language tags in the IANA Language Subtag Registry.

Step 2. Paste the code in the Header section in our Code Injection feature.


lang.png



Step 3. Press the Save Changes button.
    • Related Articles

    • How to block search indexing with 'noindex'

      You can prevent a ExploreMyPC project from appearing in Google Search by including a noindex meta tag in the header HTML code. When Googlebot next crawls that page and sees the tag or header, Googlebot will drop that page entirely from Google Search ...
    • Free SSL included

      SSL stands for Secure Sockets Layer and is the standard security technology for establishing an encrypted link between a web server and a browser. This link ensures that all data passed between the web server and browser remains private. In other ...