Skip to main content
The WP Rocket Integration registers two read-only abilities in the mainwp-wp-rocket category. Both use the mainwp/ namespace on your MainWP Dashboard.

What You’ll Learn

  • List sites that have stored WP Rocket data on your Dashboard
  • Read the saved WP Rocket feature switches that apply to one site
  • Tell whether a site uses its own settings or the global settings

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_json examples below
  • A WP Rocket Integration release with Abilities support, active on MainWP Dashboard
  • An authenticated WordPress user with manage_options and access to the WP Rocket Integration
  • Access to each site you want to read
Use an Application Password or the authentication methods in the Abilities API overview. The examples use an Application Password. Team Control restrictions also apply. Both abilities check the user’s access to the WP Rocket Integration. The list returns only sites the user can access, and the settings read checks access to the requested site. Users without manage_options are denied even if Team Control grants them the Add-on.

Available Abilities

Discover the abilities and their schemas:
Both abilities are marked readonly: true, destructive: false, and idempotent: true.
These abilities read what MainWP Dashboard has stored. They do not contact child sites or WP Rocket, sync sites, save settings, or clear or preload cache. The results show saved Dashboard settings, not a live query of WP Rocket on the child site. To change settings or clear cache, use the WP Rocket Integration pages.

List WP Rocket Sites

Ability: mainwp/list-wp-rocket-sites-v1
Method: GET
Use this to find which sites have WP Rocket data on your Dashboard, whether WP Rocket is active, and whether a site overrides the global settings.
The input is optional. Omit it, pass null, or pass an object with any of these properties. Extra properties are rejected. Example response:
While truncated is true, request the next page. A page beyond the last one returns an empty sites array with the normal total. Only sites with stored WP Rocket data appear. A site you can access that is not listed can still be read with Get WP Rocket Site Settings, which then returns the global settings. When you pass a site_id that does not exist, or that you cannot access, the ability returns a standard Dashboard error.

Get WP Rocket Site Settings

Ability: mainwp/get-wp-rocket-site-settings-v1
Method: GET
Use this to check which WP Rocket features are switched on for a site, for example before troubleshooting caching or auditing configuration across clients. The only input is the required site_id. Supply a positive integer such as 1, or its decimal string form such as "1". Extra properties are rejected.
Example response (shortened):
The full response always contains every field listed below.

Settings source

source tells you which saved settings the response reflects: If the override is enabled but no readable site settings are saved, the response falls back to global. wp_rocket_active reflects the site’s stored record and is false when the site has none.

Cache lifespan

cache_lifespan is the saved lifespan number, and cache_lifespan_unit_seconds is its unit: 3600 for hours or 86400 for days. Multiply them to get the lifespan in seconds. A cache_lifespan of 0 means cache never expires. Either field is null when the value is missing or invalid.

Feature switches

Each feature field is a boolean. A switch that was never saved returns false. The response contains only these switches and the cache lifespan. It never returns API keys, email addresses, Cloudflare zone details, CDN hostnames, URLs, cookies, user agents, or exclusion lists.

Error Handling

Standard authentication, schema, and method errors follow the Abilities API error reference. These abilities can also return: