Back to Community

How to Prevent GTranslate from Translating Numbers, Dates, and Specific Text

36 threads Sep 10, 2025 PluginTranslate wordpress with gtranslate

Content

A common challenge for users of the 'Translate WordPress with GTranslate' plugin is its tendency to automatically translate content that should remain unchanged. Based on community reports, this frequently affects numbers, dates, brand names, acronyms, and other specific text snippets, leading to broken functionality or confusing user experiences.

Why Does This Happen?

The 'Translate WordPress with GTranslate' plugin uses automated machine translation to process page content. This system is designed to translate all text it encounters. Consequently, it can misinterpret numerical data, dates, and specialized terminology (like 'A-Z' becoming 'Arizona' or 'XMAS' becoming 'Potatoes') as words that need to be translated into the target language.

The Most Common Solution: The 'notranslate' Class

The primary method to prevent unwanted translations is to use the notranslate HTML class. This class acts as a signal to the translation engine to skip the enclosed content.

How to Implement It:

  1. Identify the Element: Use your browser's inspector tool to find the HTML element containing the text you want to protect (e.g., a <span>, <div>, or <td>).
  2. Add the Class: Modify the element's code to include class="notranslate".

Example 1: Protecting a Number in a Table
Before: <td>18.00</td>
After: <td class="notranslate">18.00</td>

Example 2: Protecting a Brand Name in a Title Tag
Before: <span>MyBrandName</span>
After: <span class="notranslate">MyBrandName</span>

Example 3: Protecting a Date Picker (via JavaScript)
If you cannot edit the source HTML directly, you can use JavaScript to add the class after the page loads:
document.querySelector('#your-date-picker-id').classList.add('notranslate');

Important Considerations

  • Wrapper Elements: For dynamic elements or complex features like calendar date pickers, adding the notranslate class to a parent wrapper element is often more effective than targeting individual numbers.
  • Limitations of the Free Version: The 'notranslate' class is the main solution provided for the free version of the plugin. As noted in many support threads, the team behind 'Translate WordPress with GTranslate' often suggests that their paid version may handle these issues 'out of the box' without requiring manual code changes.
  • Automatic Translation Quirks: Some translation oddities, like certain text being converted to uppercase in specific languages, may be a result of the underlying Google Translate engine and cannot always be fixed with CSS or the notranslate class.

By strategically using the notranslate class, you can gain greater control over what gets translated, ensuring that critical data and branding remain consistent across all languages on your site.

Related Support Threads Support