WP Manifestindependent plugin directory
manifest / i18n / custom-api-translator-for-wpml

Custom AI API Translator for WPML

Custom AI API Translator for WPML is a free open-source WordPress plugin that automates translations using your own OpenRouter API key. Cut localization costs by connecting top LLMs like Claude, GPT-4o, or Gemini directly to your WPML translation queue. Perfect for websites and agencies looking to bypass expensive credit markups.

★ 1stars
v1.0.0latest · 4mo ago

Install

Download custom-ai-api-translator-for-wpml.zip From the v1.0.0 release on GitHub, Jun 15, 2026

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/texb34/custom-api-translator-for-wpml/releases/download/v1.0.0/custom-ai-api-translator-for-wpml.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Automatically translate WPML "translate yourself" jobs with any LLM through the OpenRouter API — post content and the custom fields WPML is set to translate.

Description

This plugin watches WPML's local translation queue ("Translate yourself" jobs) and translates them automatically using a Large Language Model of your choice via OpenRouter — Claude, GPT, Gemini, DeepSeek, Llama, Mistral, and more.

For every pending job it:

  1. Reads the source post (title, content, excerpt).
  2. Translates those fields with your selected model.
  3. Translates the custom fields WPML is configured to translate (see below).
  4. Writes the result to the correct translated post and links it into WPML's translation group in the right language.
  5. Marks the WPML job complete.

It runs automatically every 15 minutes (WP-Cron) and can also be triggered on demand from the settings screen.

Which custom fields get translated?

A custom field is translated when either:

  • WPML is set to "Translate" for that field (WordPress → WPML → Settings → Custom Fields Translation). This is the standard mechanism — SEO plugins like Yoast SEO and Rank Math register their fields here automatically, as do ACF and many others. Whatever WPML is told to translate, this plugin translates. Fields set to "Copy" or "Don't translate" are respected and left alone.
  • The field is a well-known SEO field from a plugin that does not register with WPML (e.g. SiteSEO). The built-in allowlist covers SiteSEO, Yoast, and Rank Math title/description/keyword fields out of the box.

You can extend the allowlist with the caat_translatable_meta_keys filter.

Page builders

Content stored as structured data by page builders (Elementor _elementor_data, Divi, Beaver Builder, WPBakery, SiteOrigin, Brizy, Oxygen, Cornerstone) and serialized/JSON meta is never sent to the LLM, so it is never corrupted. The plugin translates the standard post fields and WPML-registered text custom fields. For deep, block-level translation of page-builder layouts, use WPML's own translation editor for those pages — this plugin and WPML's editor coexist safely.

Privacy / data

Post content and the translatable fields are sent to OpenRouter (and onward to the model provider you choose) for translation. Your API key is stored AES-256 encrypted in the database. No data is sent anywhere else.

Installation

  1. Install and activate WPML Multilingual CMS (and WPML String Translation if you translate string packages).
  2. Upload this plugin and activate it.
  3. Go to Settings → WPML AI Translator.
  4. Enter your OpenRouter API key, pick a model, and click Test Connection.
  5. Enable Auto-Translate Jobs, or use Translate Now with AI to process the queue immediately.

Frequently Asked Questions

Does it touch jobs sent to a paid translation service?

No. Only local/self ("Translate yourself") jobs are processed. Jobs assigned to an external translation service are never modified.

Will it overwrite translations I edited by hand?

It only processes jobs in the "waiting" or "in progress" state. Completed translations are left untouched.

Which models can I use?

Any model available on OpenRouter — enter its model ID (e.g. anthropic/claude-3.5-sonnet, openai/gpt-4o, google/gemini-2.0-flash-001).

Changelog

1.1.0

  • Language-aware writing via wpml_update_escaped_post() so translations stay in the correct language and translation group (fixes posts being saved as a new source-language draft).
  • Translations re-linked into the source's translation group via WPML's own API.
  • Translated post inherits the source's publish status.
  • Custom-field translation now respects WPML's per-field setting (Translate / Copy / Ignore) and falls back to a built-in SEO allowlist (SiteSEO, Yoast, Rank Math) for fields not registered with WPML.
  • Structured page-builder / serialized / JSON meta is never sent to the LLM (Elementor, Divi, Beaver, WPBakery, SiteOrigin, Brizy, Oxygen, Cornerstone).
  • Custom-field write-back works whether or not WPML pre-created the target post; multi-value safe.
  • Processes both local and empty translation-service jobs.
  • Strips stray markdown code fences from model output.

1.0.0

  • Initial release.

Releases

1 release. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.0.0 latest
Jun 15, 2026 4mo ago
custom-ai-api-translator-for-wpml.zip
0