For the complete documentation index, see llms.txt. This page is also available as Markdown.

Install WordPress

Install WordPress on an existing website.

Install WordPress

post

Install WordPress on an existing website.

The website must already exist before calling this endpoint. To create a new website first, use POST /api/hosting/v1/websites and poll GET /api/hosting/v1/websites until it appears.

Call GET /api/hosting/v1/wordpress/installations filtered by username and domain before proceeding to check whether WordPress is already installed on the target domain/path. If WordPress already exists and overwrite is false (the default), the async job will fail.

This operation is asynchronous: a successful response only means the install job has been queued, not that WordPress is ready. Installation typically takes 1-2 minutes. Poll GET /api/hosting/v1/wordpress/installations filtered by username and domain to track progress. When the installation appears in that list, WordPress is ready.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
Body
domainstringRequired

Domain of the existing website where WordPress will be installed

Example: example.com
site_titlestringRequired

Title of the WordPress site

Example: My site
languagestring · nullableOptional

WordPress locale. Defaults to en_US when omitted.

Example: en_US
directorystring · nullableOptional

Relative directory to install WordPress into. Defaults to the website root when omitted.

Example: public_html
overwriteboolean · nullableOptional

When false (default), does not replace an existing installation. If WordPress is already installed on the domain/path, the async install job fails unless true.

Example: false
auto_updatesstring · enum · nullableOptional

WordPress core auto-update policy

Example: minorPossible values:
versionstring · nullableOptional

WordPress core version to install. If omitted, the latest core version compatible with the account vhost PHP version is selected.

Example: 6.5.2
Responses
200

Success empty response

application/json
messagestringOptionalExample: Request accepted
post/api/hosting/v1/accounts/{username}/wordpress/installations
POST /api/hosting/v1/accounts/{username}/wordpress/installations HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 282

{
  "domain": "example.com",
  "site_title": "My site",
  "language": "en_US",
  "directory": "public_html",
  "overwrite": false,
  "auto_updates": "minor",
  "version": "6.5.2",
  "credentials": {
    "email": "owner@example.com",
    "login": "admin",
    "password": "********"
  },
  "database": {
    "name": "mydb",
    "password": "********"
  }
}
{
  "message": "Request accepted"
}

Last updated

Was this helpful?