Update a translation language is a WordPress ability from TranslatePress — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Update a translation language
WriteChange the URL slug and publish status of a language that's already configured in TranslatePress.
Requires the TranslatePress plugin on WordPress 6.9+ (or the Abilities API feature plugin). All abilities require the current user to have the 'manage_options' capability.
What it does
This ability updates the URL slug and published flag for an already-configured translation language, persisting the change through TranslatePress's settings sanitizer. It requires the language to already be configured (add it first via add-language), rejects an empty slug after sanitization, refuses to unpublish the site's default language since it must always remain published, and rejects a slug that collides with another configured language's slug. On success it returns the updated language code along with its resulting slug and published state.
See it in action
You ask your AI assistant
"Update the German translation in TranslatePress to use the URL slug 'de' and make sure it's published."
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| language_code | string | Yes | Locale code of the language to update. |
| slug | string | Yes | URL slug for this language. |
| published | boolean | Yes | Whether this language is published on the front end. |
Returns
An object with the updated language code, its resulting slug, and its resulting published boolean state.
Permission
The current user must have the 'manage_options' capability; otherwise the ability returns a 403 WP_Error.
More TranslatePress abilities
Add a translation language
Add a new translation language to TranslatePress, subject to the current license's language limit.
Enable Automatic Translation
Turns on TranslatePress's Automatic Translation, optionally selecting which translation engine to use.
List available language codes
Return the full catalog of locale codes TranslatePress recognizes, each with its English name.
List configured languages
Retrieve the languages currently configured in TranslatePress, including which is the default and which are published.
Remove a translation language
Remove a configured translation language from TranslatePress.
Set the default language
Promote an already-configured language to be TranslatePress's site default.