Skip to main content
MainWP registers 7 tag management abilities into the WordPress Abilities API framework. Tags (also called groups) help organize sites for filtering and batch operations.
Tag abilities can access only tags owned by the calling WordPress user when per-user mode is enabled (mainwp_is_single_user is false). Lists omit other users’ tags. Reading, updating, or deleting another user’s tag returns the same missing-tag error as an unknown tag, with the ability’s usual response format. Team Control permissions can limit access further, but cannot grant access to another user’s tags. Default single-user installations are unchanged, and administrators follow the same ownership rule in per-user mode.

What You’ll Learn

  • Listing, filtering, and retrieving tag information
  • Creating, updating, and deleting tags
  • Retrieving sites and clients associated with tags

mainwp/list-tags-v1

List MainWP tags with pagination and filtering. Method: GET (readonly)
Input Parameters: Response:

mainwp/get-tag-v1

Get detailed information about a single tag. Method: GET (readonly)
Input Parameters: Response:

mainwp/add-tag-v1

Create a new tag. Method: POST
Input Parameters: Response:

mainwp/update-tag-v1

Update an existing tag. Method: POST
Input Parameters: Response: Returns the updated tag object.

mainwp/delete-tag-v1

Delete a tag. This is a destructive operation that requires confirmation. Method: DELETE
Input Parameters: Response:
Dry run response:

mainwp/get-tag-sites-v1

Get sites associated with a tag. Method: GET (readonly)
Input Parameters: Response:

mainwp/get-tag-clients-v1

Get clients associated with a tag (clients whose sites have this tag). Method: GET (readonly)
Input Parameters: Response: