---
title: "Update WordPress installation language"
method: POST
path: "/WPX/set_language"
tags: ["WPX"]
---

# Update WordPress installation language

`POST /WPX/set_language`

## Request

- Base URL: `https://cpanel-server.tld:2083/execute`
- URL: `https://cpanel-server.tld:2083/execute/WPX/set_language`
- Auth: HTTP basic

This function sets the active WordPress language for an installation that
the caller owns. The system installs the translation files if the site does
not already have them, then activates the locale.

  **Note:**

  - The system verifies that the caller owns the installation before it
    changes anything.
  - `get_admin_account` does not report the active language. There is no
    function that reads it back.

## Request body `application/x-www-form-urlencoded`

- object
  - `id` integer, required: The WordPress Toolkit installation id, as returned in the `wptk_id` field of `list_websites`.
  - `language` string, required: The WordPress locale to activate, for example `en_US`, `de_DE`, or `pt_BR`. This is a WordPress locale, not a cPanel locale. The system accepts any locale name that matches the documented pattern, so the list is not fixed. A locale that WordPress does not publish fails when the system tries to install its translation files. The `en_US` locale needs no translation files, so the system only activates it.

## Response `200`

The HTTP request was successful.

- object
  - `apiversion` integer: The version of the API.
  - `func` string: The name of the method called.
  - `module` string: The name of the module called.
  - `result` object
    - `data` object: The installation and the locale that is now active.
      - `id` integer: The installation id that the system changed.
      - `language` string: The locale that is now active. This echoes the requested value.
    - `errors` string[], nullable: List of errors if the API failed.
    - `messages` string[], nullable: List of messages generated by the API.
    - `metadata` object
      - `transformed` 1: Post-processing may have transformed the data.
    - `status` 1 | 0: - `1` - Success. - `0` - Failed: Check the errors field for more details.
    - `warnings` string[], nullable: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.

## Changes

- **2026-09-23** `aed66b1a51cc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cpanel/apis/cpanel-uapi/changes/WPX/set_language/post.md)

---

[API](https://skmtc.dev/cpanel/apis/cpanel-uapi.md) - [All operations](https://skmtc.dev/cpanel/apis/cpanel-uapi/llms.txt) - [OpenAPI document](https://skmtc.dev/cpanel/apis/cpanel-uapi/revisions/05239220da37?raw)
