---
title: "Import an existing WordPress site"
method: POST
path: "/WPX/import_website"
tags: ["WPX"]
---

# Import an existing WordPress site

`POST /WPX/import_website`

## Request

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

This function imports an existing WordPress site to your cPanel account.
The import runs in the background, so the function returns as soon as it
queues the task.

  **Note:**

  - This function has the following prerequisites:
      - The `nova-wordpress` entitlement.
      - The `redirects`, `wp-toolkit`, `wp-toolkit-site-import`, and
        `mysql` features.
  - Because the request carries the source WordPress credentials, use the
    `POST` method and do not place the `source_password` or `source_user`
    keys in the URL query string. The system rejects a request that uses
    another method, or that puts either key in the query string, before it
    reads the credentials, so they cannot leak into access logs, proxy
    logs, or browser history.
  - The background task can still fail after this function returns, for
    example when a feature is revoked in the meantime. Read the outcome
    from the `WPX::get_task_progress` function.

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

- object
  - `domain` string, required: The destination domain for the import. The cPanel account must own the domain, and the domain must have its own document root. The system normalizes the value to lowercase.
  - `overwrite` 1 | 0: Whether to overwrite an existing WordPress installation at the destination. - `1` - Overwrite. - `0` - Do not overwrite.
  - `password_type` 'admin' | 'application': The password type supplied in the `source_password` parameter. - `admin` - A WordPress administrator user password. - `application` - A service account password for a third-party integration.
  - `source_password` string, required: The WordPress user's password for the source site.
  - `source_url` string, uri, required: The URL of the source WordPress site to import. **Note:** - The URL must use the `HTTPS` scheme. - The URL must resolve only to publicly routable addresses.
  - `source_user` string, required: The WordPress username for the source site.

## 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: On the normal start path the object contains the `status`, `domain`, `task_id`, `sse_url`, and `install_id` return values. When the destination domain already has a WordPress installation and the `overwrite` parameter is not set, the object instead contains the `status` field set to `collision`, plus the `domain` and `existing_installations` fields. When the PHP version is below the WordPress minimum, it contains the `status` field set to `unsupported_php`, plus the `domain` field and the `get_php_compatibility` fields.
      - `blocked_by` string[]: Which PHP versions fall below the minimum. Present only when the `status` field is `unsupported_php`. See the `get_php_compatibility` function.
      - `compatible` 1 | 0: Whether WordPress can install. Always `0`. Present only when the `status` field is `unsupported_php`.
      - `domain` string: The destination domain, normalized to lowercase.
      - `domain_package` string, nullable: The PHP package the domain runs. Present only when the `status` field is `unsupported_php`. See the `get_php_compatibility` function.
      - `domain_version` string, nullable: The domain's PHP version as `major.minor`. Present only when the `status` field is `unsupported_php`. See the `get_php_compatibility` function.
      - `domain_version_source` 'domain' | 'system_default', nullable: Where the domain's PHP version comes from. Present only when the `status` field is `unsupported_php`. See the `get_php_compatibility` function.
      - `domain_version_vhost` string, nullable: The virtual host whose PHP setting to change in MultiPHP Manager. Present only when the `status` field is `unsupported_php`. See the `get_php_compatibility` function.
      - `effective_version` string, nullable: The PHP version that decided the refusal, as `major.minor`. Present only when the `status` field is `unsupported_php`.
      - `existing_installations` object[]: The WordPress installations that already exist on the domain. Present only when the `status` field is `collision`, and never empty in that case.
        - `id` integer: The WordPress Toolkit installation id. Pass it to `remove_installation`.
        - `url` string: The site URL of the existing installation. This is an empty string when the system could not determine it.
      - `install_id` string: The unique correlator for the import run. Pass it to `get_task_progress` to poll progress with a cPanel API token. Present only when the `status` field is `running`.
      - `is_fallback` 1 | 0: Whether a PHP version lookup failed. Present only when the `status` field is `unsupported_php`. See the `get_php_compatibility` function.
      - `required_version` string: The minimum PHP version WordPress requires. Present only when the `status` field is `unsupported_php`.
      - `sse_url` string: The path to the Server-Sent Events stream that reports import progress. This is a path, not a full URL. Resolve it against the cPanel host that served the request. An interactive cPanel session can read this stream, but a cPanel API token cannot. Present only when the `status` field is `running`.
      - `status` 'running' | 'collision' | 'unsupported_php': The outcome of this call. - `running` - The system queued the import task. The `task_id`, `sse_url`, and `install_id` fields are present. - `collision` - The destination domain already has a WordPress installation. The `existing_installations` field is present, and the system queued nothing. - `unsupported_php` - The PHP version is below the WordPress minimum. The `get_php_compatibility` function's return fields are present, and the system queued nothing.
      - `system_default_package` string, nullable: The server's default PHP package. Present only when the `status` field is `unsupported_php`. See the `get_php_compatibility` function.
      - `system_default_version` string, nullable: The server's default PHP version as `major.minor`. Present only when the `status` field is `unsupported_php`. See the `get_php_compatibility` function.
      - `task_id` string: The queued import task id. Pass it to `get_task_status` to check whether the task is still queued. Present only when the `status` field is `running`.
    - `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-11-04** `05239220da37`: 1 warning, 11 info
  - added the new `unsupported_php` enum value to the `result/data/status` response property for the response status `200`
  - added the optional property `result/data/blocked_by` to the response with the `200` status
  - added the optional property `result/data/compatible` to the response with the `200` status
  - added the optional property `result/data/domain_package` to the response with the `200` status
  - …8 more
- **2026-09-23** `aed66b1a51cc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cpanel/apis/cpanel-uapi/changes/WPX/import_website/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)
