How to manage WordPress sites

View as Markdown

List WordPress sites, rename one, read its PHP and WordPress versions, and publish state, unpublish it, and delete it with the Hosting API.

Overview

This page covers the Hosting API v1 tasks for an existing WordPress site (appType=MHWP). You list sites, rename one, read its PHP and WordPress versions and its publish state, unpublish it, and delete it.

Renames are synchronous and return the updated site. An unpublish returns an AppOperation that you poll with GET /v1/hosting/app-operations/{operationId}. A delete returns 204 No Content and removes the site in the background, with no operation to poll.

Go to How to create and publish a WordPress site for creating a site and taking it live. The code blocks use $BASE_URL for the API host (https://api.godaddy.com), $GODADDY_PAT for your Personal Access Token, and $APP_ID for the site id, like MHWP-a1b2c3d4e5.

Prerequisites

The following prerequisites are required before you can manage WordPress sites:

  • an Airo App Builder subscription with at least one WordPress site
  • (API only) a Personal Access Token with hosting.application:read, plus hosting.application:update to rename, hosting.deployment:execute to unpublish, and hosting.application:delete to delete
  • (API only) jq for the curl examples
  • (CLI only) the GoDaddy CLI installed and signed in

List sites

GET /v1/hosting/apps?appType=MHWP returns a page of WordPress sites in items. The default page size is 25 and the maximum is 100. Follow links[rel=next].href for the next page.

The following procedure lists the WordPress sites on your account.

  • List the sites:

    gddy hosting app list --app-type MHWP

The list leaves out sites that are being deleted. Add totalRequired=true to get totalItems and totalPages. Any query parameter the endpoint doesn't define returns 400.

Rename a site

PATCH /v1/hosting/apps/{appId} takes a JSON Patch body and returns 200 with the updated site. WordPress sites accept one operation: replace on /name.

The new name must be 1–200 characters. Renaming doesn't change the WordPress site title.

The following procedure renames a site.

  • Replace the site name:

    gddy hosting app update --app-id "$APP_ID" --name my-renamed-site

A replace on /rootPath returns 422 ROOT_PATH_NOT_APPLICABLE, because a WordPress site serves from a fixed document root. Any other operation or path returns 400.

Read runtime versions

GET /v1/hosting/apps/{appId}/runtime returns an array with one entry per runtime component: PHP and WORDPRESS, each with its version.

The following procedure reads the PHP and WordPress versions of a site.

  • Read the runtime versions:

    gddy hosting runtime get --app-id "$APP_ID"

Older sites might return only the WORDPRESS entry. An empty array isn't an error, so handle a missing entry in your code.

Read the publish state

GET /v1/hosting/apps/{appId}/publish-state returns published: true when the site is live at urls.publish, false when it shows its holding page. The response omits firstPublishedAt until the site is first published, and updatedAt until the state is first set.

The following procedure reads whether a site is published.

  • Read the publish state:

    curl -s "$BASE_URL/v1/hosting/apps/$APP_ID/publish-state" \
      -H "Authorization: Bearer $GODADDY_PAT" | jq '{published, firstPublishedAt, updatedAt}'

updatedAt can advance for reasons other than a change to published, so compare published itself to detect a change.

Unpublish a site

PUT /v1/hosting/apps/{appId}/publish-state with exactly {"published": false} puts the holding page back in front of the site. It returns 202 Accepted with an AppOperation of type SET_PUBLISH_STATE.

Unpublishing skips the subscription and plan-limit checks, so it works on an inactive subscription too. Unpublishing a live site frees a published-site slot on your Airo App Builder plan, which sets how many sites can be published at once. The free plan allows none. Go to Set an application's publish state for how the limit works.

The following procedure unpublishes a site.

  • Set the publish state to false:

    gddy hosting app unpublish --app-id "$APP_ID"

Poll GET /v1/hosting/app-operations/{operationId} every 2–5 seconds until status is COMPLETED or FAILED. Go to Poll the publish operation for the polling code.

An unpublish of a site that's already unpublished returns an operation that's already COMPLETED. While a publish of the site is still running, an unpublish returns 409 PUBLISH_STATE_CHANGE_IN_PROGRESS.

Delete a site

Irreversible

Deleting a WordPress site removes it permanently. You can't undo it.

DELETE /v1/hosting/apps/{appId} returns 204 No Content and starts removing the site. There's no operation to poll.

The following procedure deletes a site.

  • Delete the site:

    gddy hosting app delete --app-id "$APP_ID"

While the site is being removed, GET /v1/hosting/apps/{appId} returns it with status DELETING. After removal ends, the same call returns 404 APP_NOT_FOUND. A repeat DELETE during removal returns 204 and starts nothing new. After removal, it returns 404.

Example responses

List response

GET /v1/hosting/apps?appType=MHWP returns the sites in items. A next link means there's another page:

{
  "items": [
    {
      "id": "MHWP-a1b2c3d4e5",
      "name": "my-site",
      "appType": "MHWP",
      "status": "ACTIVE",
      "urls": { "publish": "https://my-site.myftpupload.com" },
      "createdAt": "2026-11-09T14:02:11Z",
      "updatedAt": "2026-11-09T14:02:52Z",
      "links": [
        { "rel": "self", "href": "/v1/hosting/apps/MHWP-a1b2c3d4e5" }
      ]
    }
  ],
  "links": [
    { "rel": "self", "href": "/v1/hosting/apps?appType=MHWP&pageSize=100" }
  ]
}

Rename response

PATCH /v1/hosting/apps/{appId} returns the full site with the new name:

{
  "id": "MHWP-a1b2c3d4e5",
  "name": "my-renamed-site",
  "appType": "MHWP",
  "status": "ACTIVE",
  "urls": { "publish": "https://my-site.myftpupload.com" },
  "createdAt": "2026-11-09T14:02:11Z",
  "updatedAt": "2026-11-09T15:10:04Z",
  "links": [
    { "rel": "self", "href": "/v1/hosting/apps/MHWP-a1b2c3d4e5" }
  ]
}

Runtime response

GET /v1/hosting/apps/{appId}/runtime returns one entry per runtime component:

[
  { "runtime": "PHP", "version": "8.3" },
  { "runtime": "WORDPRESS", "version": "7.1.4" }
]

Publish state response

GET /v1/hosting/apps/{appId}/publish-state for a site that's live:

{
  "published": true,
  "firstPublishedAt": "2026-11-09T14:05:30Z",
  "updatedAt": "2026-11-09T14:05:30Z",
  "links": [
    { "rel": "self", "href": "/v1/hosting/apps/MHWP-a1b2c3d4e5/publish-state" }
  ]
}

Unpublish response

PUT /v1/hosting/apps/{appId}/publish-state returns a SET_PUBLISH_STATE operation with no app:

{
  "operationId": "MHWP-q4r5s6t7",
  "type": "SET_PUBLISH_STATE",
  "status": "PENDING",
  "createdAt": "2026-11-09T15:10:04Z",
  "links": [
    { "rel": "self", "href": "/v1/hosting/app-operations/MHWP-q4r5s6t7" },
    { "rel": "poll", "href": "/v1/hosting/app-operations/MHWP-q4r5s6t7" }
  ]
}

Common errors

WordPress site errors use the envelope {name, correlationId, message, details}. Branch on details[].issue, not on name or message. The following table lists the errors these tasks can return:

StatusIssue codeCauseWhat to do
400VALIDATION_FAILEDThe name, patch, publish-state body, or list query parameters aren't validRead details[].field, fix the request, and retry
401(empty body)The PAT is expired or revoked, or it doesn't have the scope the call needs. A PAT without the scope can get an empty 401 instead of 403Check the scope for the call. A missing scope can return 401 or 403, so handle both. Create a new PAT if needed
401OAUTH_REQUIRED, INVALID_TOKENNo bearer token, or the token is invalidSend Authorization: Bearer $GODADDY_PAT with a current PAT
403INSUFFICIENT_SCOPE, ACCESS_DENIEDThe token doesn't have the scope the call needs, or the account can't use the API. For a missing scope the body can be emptyAdd the scope: create a new PAT with it, or sign in to gddy again and approve it. Or use an account with API access
404APP_NOT_FOUNDThe id doesn't exist, doesn't belong to your account, or the site's removal has endedCheck the id with GET /v1/hosting/apps?appType=MHWP
409PUBLISH_STATE_CHANGE_IN_PROGRESSA publish of the site is running, or another publish-state request on the subscription is being acceptedIf a publish is running, poll its operation, then retry the unpublish. Otherwise retry after a few seconds
422ROOT_PATH_NOT_APPLICABLEThe patch tried to change /rootPathChange /name only
422APP_DELETINGThe site is being deleted, so it can't be renamed or unpublishedStop sending writes for this site
429(empty body)The rate limit is reachedWait the number of seconds in Retry-After if it's present, otherwise in RateLimit-Reset, then retry. Go to Troubleshoot Hosting for the limits
501NOT_APPLICABLEThe id belongs to a Node.js app, which has no publish stateUse a WordPress site id (MHWP- prefix)
503UPSTREAM_UNAVAILABLEAnother write holds the site's lockWait for the Retry-After value (5 seconds), then retry
Operation FAILEDPUBLISH_STATE_CHANGE_FAILEDThe unpublish didn't finish, and the site keeps its previous stateRetry the PUT. Contact GoDaddy support with the correlationId if it fails again

Go to Troubleshoot Hosting for every error a WordPress site request can return.

Agent & Automation Notes

Scopeshosting.application:read, hosting.application:update, hosting.application:delete, hosting.deployment:execute
Rate limitPUT /apps/{appId}/publish-state: 10 req/min and 100 req/hour per customer. Other WordPress site routes: 600 req/min per customer. A 429 can have an empty body and RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset headers. Wait the number of seconds in Retry-After if present, otherwise in RateLimit-Reset, before retrying.
IdempotentYes
DestructiveYes — confirm before executing
On failureReads, renames, and unpublishes are safe to retry. Delete is irreversible: confirm the site id first. A repeat DELETE during teardown returns 204 and starts nothing new. On 503 UPSTREAM_UNAVAILABLE with Retry-After: 5, wait 5 seconds and retry. On 409 PUBLISH_STATE_CHANGE_IN_PROGRESS, poll the running publish if there is one, then retry; otherwise retry after a few seconds.

Last updated on

How is this guide?

On this page