Skip to content
Developers

Turn WordPress debug mode on or off

POST /api/v2/shared-hosting/{accountId}/wordpress/{siteId}/actions/debug-mode

Turns WordPress debug mode (WP_DEBUG in the site’s wp-config.php) on or off for one site. The change is made before the response returns. Nothing else on the site changes.

With debug mode on, warnings and notices from WordPress, plugins and themes can show on the site’s pages, also to visitors. Turn it on to find the cause of an error and turn it off again afterwards. With debug mode off, those lines are no longer shown.

The web hosting account must be active and on cPanel. A change that could not be made returns 502 upstream_failed.

Authentication: An API key with the scopes write:hosting and console:services. About keys and scopes

Request

Path parameters

accountIdstringrequired
The web hosting account ID (acct_…).
siteIdstringrequired
The WordPress site ID (wp_…).

Body

enabledbooleanrequired
true turns debug mode on. false turns it off.

Example

POST /api/v2/shared-hosting/{accountId}/wordpress/{siteId}/actions/debug-mode
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/wordpress/wp_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/debug-mode" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true
}'

Responses

200 Debug mode was changed.

Response 200
{
"id": "wp_01hxa3b4c5d6e7f8g9h0j1k2m3",
"debugMode": false
}
Response fields
idstring
The WordPress site ID (wp_…).
debugModeboolean
The state after the call: true when debug mode is on.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400siteId is invalid or enabled is not true or false (invalid_request).
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is wp_installation_not_found.
409account_not_eligible_cpanel: the account is not on cPanel.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.
502Debug mode could not be changed right now (upstream_failed).

Stuck?

The assistant in the client area knows this API and can look at your account. When you contact support about a failed call, include the requestId from the error response.