mainwp-clone category. All use the mainwp/ namespace on your MainWP Dashboard.
What You’ll Learn
- Read one site’s current stored Clone policy
- Enable or disable Clone globally
- Allow or disallow one site’s participation
- Interpret save results and apply settings through a later sync
Prerequisites
- WordPress 6.9 or later on the MainWP Dashboard site
- MainWP Dashboard with Abilities API support; use version 6.2 or later for the
input_jsonexample below - Clone 5.1 or later, active and available in MainWP Dashboard
- An authenticated WordPress user with
manage_optionsand access to the Clone Add-on - Access to the selected MainWP site for site-specific calls
Available Abilities
Discover the abilities and their full input and output schemas:
site_id: a positive integer such as 1 or its canonical decimal string form such as "1". Domains, URLs, zero, leading zeros, and decimal or exponent strings are not accepted. enabled and allowed must be JSON booleans, not strings or numbers. All three abilities reject extra input properties.
Read Site Clone Policy
Ability:mainwp/get-site-clone-policy-status-v1Method: GET
Eligibility describes permission to receive Clone choices on a future successful sync. It does not establish that the Child has received those settings, that a source is available, or that server resources and connections are sufficient to complete a clone. The response does not include source-site choices, credentials, or a clone job’s status.
Set Global Clone Enablement
Ability:mainwp/set-clone-enabled-v1Method: POST
enabled is the only input and is required. Set it to false to disable Clone globally. This setting does not erase per-site exclusions.
Example response when the setting changes:
result is changed when the stored policy changes or unchanged when it already matches. A successful response confirms the Dashboard setting was persisted or already matched. Child application remains unknown until the affected sites are synced separately.
Set Site Clone Participation
Ability:mainwp/set-site-clone-participation-v1Method: POST
site_id and allowed are required. allowed: false adds that site to the disallowed set; allowed: true removes it. The call preserves other sites’ participation settings and does not change global enablement.
Example response when the site becomes disallowed:
result (changed or unchanged) with the site policy fields. Allowing a site while global Clone is disabled leaves destination_eligible set to false.
Participation also affects which sites can appear as clone sources in the choices sent during sync. After changing a site’s participation, sync the affected destinations to update their source choices as well as that site’s own destination policy.
Applying Policy and Handling Errors
The two write abilities apply the requested Dashboard setting immediately. They do not supportdry_run, confirm, a caller-supplied revision, or a request ID. Internal save checks protect the stored policy against concurrent writes; the revision checks used by the Dashboard’s Save Selection interface are not API input fields.
Both writes are marked idempotent: requesting the same desired value again does not create a clone or a new task. After a conflict or uncertain response, read the current site policy and check that the desired setting is still appropriate before retrying.
MainWP Dashboard can also return its authentication and site-access errors. An unreadable stored site policy can prevent a participation change; do not interpret that failure as a successful partial update.
These abilities do not sync Child sites, start cloning, create backups, transfer files, or restore databases. After saving policy, perform a separate successful individual sync for each affected Child site. Disabling Clone or disallowing a destination in Dashboard settings does not prove its previously received Clone choices have been removed.
Related Resources
- Clone Add-on - Settings and the Quick Clone and Clone from Backup workflows
- Abilities API Overview - Authentication and request formats
- Dashboard and Child Synchronization - How settings reach Child sites
