Check site slug availability
const url = 'https://example.com/wp-json/wp2/site-manager/v1/sites/slug-availability?slug=example';const options = {method: 'GET', headers: {'X-WP-Nonce': '<X-WP-Nonce>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/wp-json/wp2/site-manager/v1/sites/slug-availability?slug=example' \ --header 'X-WP-Nonce: <X-WP-Nonce>'Normalizes the proposed site address and checks whether the domain+path pair is free in the current network (domain_exists).
Query `slug` is required. `exclude_blog_id` — do not treat this blog_id as a conflict (rename check: if the address already belongs to that site, `available=true`).
Requires `create_sites` or `manage_network`. Multisite only.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Proposed address: subdomain (SUBDOMAIN_INSTALL) or path segment. PHP runs SlugNormalizer and builds domain+path for the current network without auto_increment.
Blog_id that should not count as taken. If domain_exists returned this id — available=true. 0 / non-numeric — treated as omitted. Used when renaming an existing site.
Responses
Section titled “Responses”Normalized slug and available flag. Empty slug after normalize → available=false, slug=“”.
object
True if the domain+path pair is free in the current network (domain_exists) or already belongs to exclude_blog_id. false if the slug is empty after normalize, the network does not resolve, or another site owns the address.
Normalized slug after SlugNormalizer and prepare_domain_and_path without auto_increment. Empty string if the input slug was empty.
Example
{ "available": true, "slug": "training"}Not_multisite — not a WordPress network.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Not authenticated. DualRest: rest_forbidden (status 401) when there is no cookie session. Cookie + X-WP-Nonce or Application Password.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Missing create_sites/manage_network or invalid REST nonce.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}