Back to blog
Our products
October 20, 2026

WPML Hardcoded Text Not Translatable? How to Find and Fix Theme Strings

WPML Hardcoded Text Not Translatable? How to Find and Fix Theme Strings

You can see the text plainly on your WordPress site—inside a button, a footer, a checkout notice, or a theme heading—yet WPML String Translation insists it does not exist. It is tempting to assume the scan failed. Often, though, the real issue is more fundamental: that text was written directly into a theme or plugin template and was never made translatable in the first place.

If you are searching for a fix to wpml hardcoded text not translatable, the important question is not “Where is the missing string?” but where does that visible text actually come from? The answer determines whether a quick setting, a theme option, a code adjustment, or a child-theme override is the right move—and whether your translation will survive the next update.

The frustrating part is that several very different problems can look identical from the front end. Once you know how to trace a stubborn phrase back to its source, you can stop chasing it through WPML screens and choose a fix that is both safe and durable.

Why WPML Cannot Translate Some Theme Text

Why WPML Cannot Translate Some Theme Text

What counts as a hardcoded string?

A visible sentence is not automatically a translatable sentence. In WordPress, hardcoded text is text written directly into code rather than passed through the theme or plugin’s translation system. A developer might place “Get Your Free Quote” in a PHP template, add a promotional banner in a page-builder template, or write a footer line such as “Serving customers since 1998” in a custom code snippet.

The same problem appears in JavaScript files: a checkout warning, pop-up label, contact-form heading, or button caption may be printed directly by a script. WPML can translate content and properly registered interface strings; it cannot reliably translate text that the code never exposes for translation.

Why String Translation does not find it

WPML String Translation depends on WordPress localization conventions. Normally, a theme wraps text in gettext functions such as __(), _e(), or esc_html__() and assigns it to a text domain. That tells WordPress, “this phrase may have a translation.”

By contrast, plain text echoed from a template has no translation hook. If a file contains a direct instruction to print “Call us today,” WPML has nothing meaningful to scan or register. This is the core of the wpml hardcoded text not translatable issue: the limitation is usually in the theme’s code, not in WPML’s translation screen.

Rule out simpler causes first

Before calling a string hardcoded, check the less dramatic explanations. Run or refresh the String Translation scan, then confirm that you are searching the correct theme or plugin text domain. A string may also belong to a theme option, a page-builder template, or a plugin rather than the active theme.

  • Clear page, object, CDN, and browser caches after saving a translation.
  • Check pages where the text actually loads; some strings register only in a specific admin or front-end context.
  • Review theme settings and Customizer fields, which may require separate translation configuration.
  • Temporarily identify the source with browser inspection or a code search for the exact phrase.

Only after those checks should you treat the text as genuinely hardcoded and plan a code-level fix.

How to Find Where the Untranslatable Text Comes From

Search the theme and plugin files for the exact phrase

When text appears on the page but nowhere in WPML’s String Translation, assume it has a physical source until proven otherwise. Copy a distinctive five- to ten-word fragment—not a generic word such as “Read more”—and search your site files with a code editor, hosting file manager, or SSH command such as grep. A developer can do this in minutes.

Search beyond the active theme. The phrase may live in a child theme, parent theme, must-use plugin, custom functionality plugin, or a snippet added through a code-injection tool. If you find plain text written directly in a PHP template rather than wrapped in a WordPress translation function, you have likely found why the wpml hardcoded text not translatable problem exists.

Check WordPress settings and template tools

Not every visible sentence comes from a file. Inspect the Customizer, the Site Editor’s templates and template parts, theme option panels, widgets, reusable blocks, and WooCommerce settings. A footer notice, for example, may be stored in a widget area rather than the footer.php file you expected.

Also check Elementor or another page builder’s global templates, popups, headers, and saved sections. These can render across dozens of pages while remaining absent from the WPML screen you first check. WPML handles multilingual structure and string workflows, but it cannot reliably expose text until you identify how the theme or plugin created it.

Use browser inspection, then test safely

Browser developer tools will not reveal the PHP file directly, but they often provide the next clue: a CSS class, block name, widget ID, or template-part wrapper. Search that identifier in the codebase and follow the trail.

Do not edit a live theme while investigating. Take a backup and reproduce the issue on staging first. Test one change at a time, clear caches, and verify every language version before deployment. That discipline prevents a small translation fix from becoming a broken header, checkout, or mobile layout.

How to Make Hardcoded Theme Text Translatable in WPML

Use the theme’s built-in translation or options field when available

When wpml hardcoded text not translatable is the search that brought you here, do not edit PHP first. The visible text may not be hardcoded at all. Check the Customizer, theme settings panel, widget, page builder template, header builder, or footer settings. If the theme stores the value as an option, translate it through the relevant WPML workflow, such as String Translation or the Translation Editor. This is the safest route because theme updates will not erase your work.

Register the string correctly with gettext

A literal line such as Welcome to our store inside a template is invisible to WPML unless the developer makes it localizable. The usual fix is to wrap it in a WordPress localization function, using the theme’s actual text domain:

  • __( ‘Welcome to our store’, ‘theme-domain’ ) when the value is returned
  • _e( ‘Welcome to our store’, ‘theme-domain’ ) when it is printed
  • esc_html__() or esc_html_e() for plain text output that needs escaping

Then rescan the theme in WPML String Translation, locate the new string under the correct domain, and add its translation. A wrong text domain is one of the most common reasons a properly wrapped string still fails to appear.

Move custom text into a child theme or custom plugin

Never treat a parent-theme edit as a permanent repair. The next update can overwrite it without warning. Put overridden template files in a child theme, or place reusable site logic in a small site-specific plugin. Preserve placeholders such as %s, existing HTML, escaping functions, and the original text-domain convention; changing any of these can break output or prevent translations from matching.

Register dynamic strings with WPML when gettext is not suitable

Gettext works best for fixed source-code strings. Text saved in custom options, generated from settings, or assembled dynamically often needs explicit WPML string registration instead. Developers can register the value through WPML’s string-registration hooks, then retrieve the translated version when rendering the page. For complex theme frameworks, ask the theme developer to implement this integration rather than patching it blindly: dynamic strings can involve repeaters, conditional fields, and values that must stay synchronized across languages.

When You Cannot Edit the Theme Code

A phrase can be visible on every checkout page and still be invisible to WPML. That is the frustrating reality behind wpml hardcoded text not translatable searches: if a theme prints text directly rather than registering it through WordPress translation functions, WPML has nothing reliable to detect or translate.

Ask the theme or plugin author for a translation-ready fix

When the code is proprietary, minified, generated by a page builder, or likely to be overwritten at the next update, contact the author first. This is not a cosmetic request; it is a compatibility issue. Send a precise report so support can reproduce it:

“The front-end phrase ‘[exact phrase]’ appears at [full URL]. It needs a [target language] translation but is not available in WPML String Translation. Could you wrap it in standard WordPress gettext functions, such as __() or esc_html__(), using the correct text domain, or register it properly for WPML?”

Include a screenshot if the label changes by device, product type, or logged-in status. “Some text will not translate” is easy to dismiss; one exact label on one exact page is actionable.

Use a developer for an update-safe patch

If the author cannot help, a small child-theme override or custom plugin is usually safer than editing vendor files. This is especially true for business-critical text: checkout labels, navigation calls to action, delivery notices, and account-area buttons. A developer can replace or filter the output, make the new string translatable, and keep the change separate from theme updates. Direct edits may work today, then disappear after version 2.1 arrives.

Speed up translation after the strings are exposed

Once the text is correctly registered in WPML, translation becomes the easier part. For sites already running WPML, LATW AI Translator for WPML is an add-on that requires an active WPML installation and translates registered WPML content and strings using your own API key. It can reduce the manual effort and credit cost of translating available items, but it is not a cure for unregistered hardcoded text. First expose the string; then automate the translation workflow.

Make the Text Visible to Translation

When WPML hardcoded text is not translatable, the fix is rarely inside WPML alone. First verify that the text is truly hardcoded, trace it to the theme, plugin, template, or custom snippet that outputs it, and look for a native setting before changing code. If code is the source, move the change into an update-safe child theme or custom plugin and wrap the string in WordPress translation functions. Then rescan the relevant theme or plugin in WPML and translate the newly exposed string.

The important distinction is simple: WPML can translate strings that WordPress makes available for translation—it cannot translate text that code prints without exposing it. Fix the source once, and that stubborn label becomes part of a multilingual site you can maintain with confidence.

Our products
Translate your website with AI
LATW Cloud
Connect your site, choose your languages, and AI translates everything in the background. Translations are saved in your own site and stay there even if you stop paying.
→ WordPress, PrestaShop, Webflow, Drupal and more
→ GPT, OpenAI, OpenRouter
→ Pay only for what you translate
Read more →
LATW for WPML
Translate posts, pages, custom fields, builder content and strings 1400× cheaper than WPML's Automatic Translation - billed to your own API key.
→ Works with everything WPML supports
→ Gutenberg, WooCommerce, Elementor, Bricks
→ Yoast & Rank Math SEO fields
Read more →
LATW Multilingual
Lightweight multilingual WordPress, built for AI translation: language switcher, clean URLs and full SEO - no WPML or Polylang required. AI translation through LATW Cloud in Free, seven engines in Pro.
→ Standalone - no WPML or Polylang needed
→ Switcher, clean URLs & full hreflang SEO
→ Paragraph-by-paragraph translation that keeps your edits
Read more →
Back to blog