How to Disable Google Translate from Translating Specific Word or Content
Do you want to disable Google Translate from translating a specific element for example paragraph, heading, etc.
Google Translate is a powerful tool that help us to translate our website's content for every language in a second.
Sometimes we might not want Google to translate a specific element or block of a content. That's why Google has provided a built in class to disable translation when necessary.
In this article, you'll learn how to disable Google Translate from translating a word, a sentence, or an entire webpage using built-in class provided by Google.
Span tag
This is the best way to tell Google to block translation for a word. Simply, add the notranslate class to the span tag.
<span class="notranslate"> Don't translate this line. </span>
How to prevent a word from being translated inside a heading.
<h2> This is a <span class="notranslate" > heading. </span><h2>
Div element
Add notranslate class to the specific div.
<div class="notranslate" > Don't translate this element. </div>
How to disable translation of an entire website.
To disable translation of an entire webpage, add the meta tag inside the head section of your website.
<meta name="google" content="notranslate"/>
Conclusion
In this article, you have learned how to disable Google Translate from translating specific words, sentence and entire website .
<p>This is a normal sentence.</p>
<p class="notranslate">
Do not translate this sentence.
</p>
By adding the notranslate class to the second <p> element, you're instructing Google Translate to skip translating the content within that specific element. This is a good way to maintain certain parts of your content in their original language.
<p>This is a normal sentence.</p>
<p translate="no">Do not translate this sentence.</p>
Try it Yourself »
By adding the translate="no" attribute to the second <p> element, you're indicating that the content within that element should not be translated. This provides an alternative method to achieve the same result as using the notranslate class.