WPML for Static WordPress? We Can Do It

WPML is the leader for WordPress translations. We're fully compatible.

WPML (WordPress Multilingual Plugin) is one of the most powerful tools for translating WordPress websites. But under the hood, it’s more than just a translation switcher—it fundamentally alters how post content, meta, taxonomy, and queries behave.

This guide is for developers, implementers, and technical site owners who want to go beyond the surface and understand what’s really happening when WPML is active on your WordPress site.

Once we cover that, we’ll show you how we make it work on a Static WordPress infrastructure.


1. WPML’s Language Architecture: Post Duplication and Mapping

WPML does not store all translations in the same post object. Instead, it creates a separate post entry for each language. These translated posts are tied together via a shared trid (translation group ID), maintained in the wp_icl_translations table.

Each translated post:

  • Has its own post ID
  • Lives in wp_posts just like a normal post
  • Has its own title, content, excerpt, slug, and more
  • Shares a common trid to link it back to the main post group

This design allows you to fully customize translated content per language—titles, permalinks, images, even layout if needed.

Where the Mapping Lives:

  • wp_icl_translations holds language code, element_id, element_type, and trid
  • element_type could be post_post, post_page, tax_category, etc.
  • Each post’s language is defined via this table, not via standard post meta

2. Meta Duplication: Behind the Scenes of Translated Custom Fields

When you duplicate a post in WPML—either manually or automatically—it creates a new post and duplicates all associated custom fields (post meta).

This can be:

  • Full duplication (all meta copied as-is)
  • Linked duplication (meta syncs when the original post updates)

These options are configured via WPML → Settings → Custom Fields Translation where you’ll see options like:

  • Copy: Field is copied once, then independent
  • Copy Once: Copied during duplication, but changes don’t sync
  • Translate: Unique per language version
  • Don’t Translate: Skipped entirely

Important Consideration:

When querying get_post_meta(), you’re always referencing the current language’s post ID, so it retrieves that language’s specific meta—even if it’s identical to the original.

3. WPML and Filters: How It Hooks Into Your WordPress Loop

WPML uses filters to ensure you’re only working with content in the current language. These include:

  • pre_get_posts – Adjusts queries to only return posts in the current language
  • get_terms – Ensures taxonomies are filtered by language
  • get_the_title, the_content, get_permalink – Localizes output
  • get_post_metadata – Filters meta fields for current-language post

If you bypass these filters (e.g. using direct SQL queries or WP_Query without WPML compatibility), you may return untranslated or cross-language content unintentionally.

Tip:

Use WPML’s API for safe multilingual queries: wpml_object_id(), icl_object_id(), icl_get_languages()

4. Taxonomy Translations

Like posts and pages, WPML also duplicates taxonomies for translation.

Each translated taxonomy term has:

  • Its own term ID in wp_terms
  • A shared trid in wp_icl_translations
  • Term meta and slugs translated as needed

This enables per-language category names, slugs, and descriptions—plus full translation of tag archives, custom taxonomies, and breadcrumb trails.

5. Media Translation and Duplication

WPML also duplicates images and attachments, especially when using the Media Translation module. Each image is copied to the translated post and can be replaced per language if needed.

You can translate:

  • Image titles
  • Captions
  • Alt text
  • Descriptions

This is stored per attachment ID in the language-specific post and referenced in the editor for clarity.

6. Programmatically Working with WPML

If you’re writing code that must be language-aware, WPML provides several helper functions:

Language-Aware Post IDs


$translated_id = apply_filters( 'wpml_object_id', $original_id, 'post', true, $language_code );
  

Get Current Language


$current_lang = apply_filters( 'wpml_current_language', NULL );
  

Retrieve All Translations of a Post


$translations = apply_filters( 'wpml_get_element_translations', NULL, icl_get_element_id($post_id, 'post_post') );
  

Disable Language Filtering Temporarily


remove_filter( 'get_post_metadata', 'wpml_get_post_metadata_filter' );
// do something...
add_filter( 'get_post_metadata', 'wpml_get_post_metadata_filter' );
  

7. Gotchas & Debugging Tips

  • Query returning missing posts? Check language filters aren’t excluding the current language.
  • Meta not updating across languages? Make sure the field is set to “Copy” or “Copy Once” in WPML field settings.
  • Wrong permalink structure? Flush permalinks after major WPML updates or language additions.
  • Need to manually map translated posts? Use wp_icl_translations to trace trid relationships.

Alright, Now How Does This Work with Static WordPress?

The Headless Hostman is an integrated platform that converts your existing WordPress site into a fully Static production site.

We support 99.9% of Plugins out of the box, especially WPML.

What Do You Need to Do? Nothing.

When you’re managing your WordPress site, there’s nothing more you need to do.

Our Full and Partial Pushes Automatically Detect, Gather, and Push All Languages

When you initiate a Full, or Push by Post Type, we automatically circulate through ALL languages within those post types.

They push without any further intervention.

Automatic Pushing of New Translations

When you edit or create a new post, WPML gets to work in the background generating the language variant of that page.

When it’s completed, we have an automatic process that will push it to Static when it’s done.

Toggling on the Frontend: the Same

On your live Static Site, toggling is the exact same and all of the relevant translation pages are there to back it up.

It’s that easy.

 

ready to get started?

Headless Hostman takes the best of both traditional CMS systems and other static host providers to create a site that is both easy to manage, fast, and secure.