AI Translator (by ROBOTSTXT) git.robotstxt.es
Translate post titles and content from the editor using the native WordPress AI client (available in WP 7.0+). Multisite-ready with global or per-site configuration.
by ROBOTSTXT · git.robotstxt.es/robotstxt/robotstxt-ai-translator · website
Install
The author publishes release zips, so WP-CLI can install straight from git.robotstxt.es:
wp plugin install https://git.robotstxt.es/robotstxt/robotstxt-ai-translator/releases/download/1.2.3/robotstxt-ai-translator-1.2.3.zipDeclares an update source (https://www.robotstxt.software/plugins/robotstxt-ai-translator/), so updates arrive through the plugin's own updater.
Readme
=== AI Translator (by ROBOTSTXT) === Contributors: robotstxt, javiercasares Tags: ai, translation, multilingual, multisite, editor Requires at least: 7.0 Tested up to: 7.1 Requires PHP: 5.6 Stable tag: 1.2.3 License: GPL-3.0-or-later License URI: https://www.gnu.org/licenses/gpl-3.0.txt
Translate post titles and content from the WordPress editor using the native WordPress AI plugin as backend. Multisite-ready.
== Description ==
AI Translator (by ROBOTSTXT) adds a one-click translation panel to the post editor. It reads the saved post title and content, sends them to the configured AI provider through the official WordPress AI plugin, and writes the translated text back into the editor for review.
The plugin is provider-agnostic: it relies on the WordPress AI plugin to route requests to whichever service the site administrator has configured (OpenAI, Anthropic, Google, etc.). No API keys are stored by this plugin.
Multisite is supported out of the box. When network-activated, the network administrator chooses between a single global configuration shared by every site, or per-site configuration where each subsite owns its own settings.
== Using the plugin ==
= Editor =
On the post edit screen, open the "AI Translator" panel (block editor sidebar or classic editor metabox). Select a target language from the dropdown and click "Translate". The plugin reads the saved version of the post, calls the configured AI provider, and replaces the title and/or content with the translated values. Review the result and save the post.
Only languages installed on the site (via Settings -> General -> Site Language, or the language pack installer) appear in the dropdown.
= WP-CLI =
The plugin exposes a single command, wp ai-translator translate, for single-post and bulk translation.
Flags
--locale=<locale>(required): WordPress locale code to translate to. The locale must be installed on the site (visible viawp language core list --status=installed). The built-inen_USis always available.--post-id=<id>(optional): ID of a single post to translate. When set,--post-type,--statusand--limitare ignored.--post-type=<type>(optional, defaultpost): Post type to translate in bulk when--post-idis not provided.--status=<status>(optional, defaultpublish): Post status filter in bulk mode.--limit=<n>(optional, default50): Maximum number of posts to process in bulk mode.--dry-run(optional): Report which posts would be translated without calling the AI provider and without writing to the database. Useful for previewing scope and verifying filters before incurring API costs.
The command respects the plugin's site settings (Translate title / Translate content). If both are disabled in the settings, the command exits with an error.
Multisite
Use the standard --url=<site-url> and --path=<wordpress-root> flags from WP-CLI to target a specific site in the network.
User context
Pass the standard WP-CLI global flag --user=<id|login> so that post updates are recorded under that user (revisions, audit logs). The command emits a warning when no user context is set.
Examples
Translate a single post to Spanish:
wp ai-translator translate --post-id=42 --locale=es_ES
Translate the latest ten pages to French, preview only:
wp ai-translator translate --post-type=page --locale=fr_FR --limit=10 --dry-run
Translate up to 200 product custom post types to Catalan on a Multisite subsite:
wp ai-translator translate --post-type=product --locale=ca --limit=200 --url=https://example.com/ca/
Bulk translate all draft posts (use with caution):
wp ai-translator translate --post-type=post --status=draft --locale=de_DE --limit=500
= REST API =
The plugin registers a single REST route in the ai-translator/v1 namespace:
POST /wp-json/ai-translator/v1/translate
Authentication
Requires authenticated access to WordPress (cookie + X-WP-Nonce header for in-browser use, or Application Passwords for external clients) and the edit_post capability on the target post. Unauthorised requests receive 401 or 403 per rest_authorization_required_code().
Request body (JSON)
post_id(integer, required): ID of an existing post.fields(array of strings, required): Which fields to translate. Allowed values:"title","content". Empty array or fields disabled in settings yield a400.target_locale(string, required): WordPress locale code. Must be installed on the site.
Response (200 OK, JSON)
Only includes the keys that were actually translated:
{ "title": "...", "content": "..." }
Errors
400invalid input (missing post, unknown locale, no enabled fields).403insufficient capability.404post not found.502upstream AI provider error (forwarded from the WordPress AI plugin).
Important
The endpoint reads the saved title and content from the database, not from the editor's current state. Save the post before translating to ensure the latest content is used.
== Extra Configurations ==
AI_TRANSLATOR_DELETE_DATA_ON_UNINSTALL (boolean, default false): when set to true in wp-config.php, the uninstall routine removes every option, sitemeta entry, and per-site setting created by the plugin. By default, plugin data is preserved on uninstall.
== Installation ==
= Requirements =
- WordPress 7.0 or higher (the
wp_ai_client_prompt()function is part of WordPress core since 7.0). - PHP 5.6 or higher.
- At least one AI provider configured in Settings → AI. The plugin works with any provider registered through the WordPress AI client — no specific AI plugin is required.
= Manual download =
Extract the contents of the ZIP and upload the contents to the /wp-content/plugins/robotstxt-ai-translator/ directory. Once uploaded, it will appear in your plugin list.
On Multisite, network-activate the plugin and configure it under Network Admin -> Settings -> AI Translator.
== Frequently Asked Questions ==
= Does this plugin call any AI provider directly? =
No. Every AI request goes through wp_ai_client_prompt(), WordPress's native AI client (introduced in WP 7.0). The plugin does not talk to any provider directly and does not store API keys. Authentication, model selection, and provider routing are handled by WordPress and whatever AI provider plugin you have configured.
= Does it work with the classic editor? =
Yes. The plugin registers a metabox in the classic editor and a sidebar panel in the block editor. Both share the same REST endpoint and language list.
= Why do I have to save the post before translating? =
The plugin reads the post title and content from the database, not from the editor's current state. This prevents prompt-injection through unsaved editor content. The UI warns you when there are unsaved changes.
== Compatibility ==
- WordPress: 7.0 - 7.1
- PHP: 5.6 - 8.5
- WP-CLI: 2.12 or newer
== Changelog ==
Only the 3 last versions. The full changelog will be at changelog.txt
= 1.2.3 =
- Manager (by ROBOTSTXT) detection now uses the ecosystem presence constant
ROBOTSTXT_MANAGER_NOTICED(Manager 1.6.2+) instead of scanning the plugin list, falling back to the plugin-list scan for older Manager versions.
= 1.2.2 =
- Added a dismissible admin notice on the Plugins list screens recommending Manager (by ROBOTSTXT) when it is not installed and active, plus a persistent warning on the plugin settings pages. Updates for the ROBOTSTXT plugins are delivered through Manager.
- Removed the bundled JSON updater (
class-robotstxt-updater.phpandupdate.json). Plugin updates are now handled by Manager. - Changed the Plugin URI and Update URI to
https://www.robotstxt.software/plugins/robotstxt-ai-translator/. - Lowered the minimum PHP version from 7.4 to 5.6 (verified with PHPCompatibility 5.6-8.5). WordPress 7.0+ remains the minimum WordPress version because the plugin uses the native WordPress AI client.
= 1.2.1 =
- Confirmed compatibility with WordPress 7.1. No functional changes.
= Previous versions =
If you want to see the full changelog, visit the changelog page.
== Compliance ==
This plugin adheres to the following security measures and review protocols for each version:
Read the full README on git.robotstxt.es →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| 1.2.3 | Aug 24, 2026 | robotstxt-ai-translator-1.2.3.zip | 1 |
| 1.2.2 | Aug 17, 2026 | robotstxt-ai-translator-1.2.2.zip | 2 |
| 1.2.1 | Aug 7, 2026 | robotstxt-ai-translator-1.2.1.zip | 3 |
| 1.2.0 | May 28, 2026 | robotstxt-ai-translator-1.2.0.zip | 26 |
| 1.1.0 | May 25, 2026 | robotstxt-ai-translator-1.1.0.zip | 25 |
| 1.0.0 | May 23, 2026 | robotstxt-ai-translator-1.0.0.zip | 32 |
Active-site estimate ≈30 comes from the median of recent superseded releases. Method.