Skip to Content
PluginsLW Site Manager

LW Site Manager

WordPress Site Manager using the Abilities API - full site maintenance via AI/REST.

Overview

Requires WordPress6.9+
Requires PHP8.1+
Tested up to6.9
LicenseGPL-2.0-or-later
GitHublwplugins/lw-site-manager 

Installation

composer require lwplugins/lw-site-manager

Or download from GitHub and upload to /wp-content/plugins/lw-site-manager.

Requirements

  • PHP 8.1 or higher
  • WordPress 6.9 or higher (requires Abilities API)

What is the Abilities API?

The WordPress Abilities API is a feature introduced in WordPress 6.9 that enables WordPress sites to expose structured, discoverable, and secure operations to external systems (AI assistants, automation tools, remote administration panels).

The Abilities API is a standardized interface through which:

  • AI systems (Claude, ChatGPT, Gemini) can understand and execute WordPress operations
  • Automation tools (n8n, Make, Zapier) can integrate with WordPress
  • Central management interfaces can control multiple WordPress sites

Why Abilities API Over REST API?

PropertyREST APIAbilities API
DiscoverabilityRequires reading documentationSelf-describing with JSON Schema
ValidationCustom implementationBuilt-in input/output validation
PermissionsCapability-basedAbility-level fine-tuning
AI IntegrationNo native supportMCP-compatible, AI-ready
AnnotationsNonereadonly, destructive, idempotent

Annotation Meanings

AnnotationMeaning
readonly: trueOnly reads, does not modify anything (GET request)
destructive: trueMay cause data loss or irreversible changes
idempotent: trueMultiple executions produce the same result

These annotations help AI systems and automation tools understand how “dangerous” an operation is and whether user confirmation is needed.

Features

Site Management

  • Updates Management - Check and apply updates for core, plugins, and themes
  • Plugin Management - Install, activate, deactivate, and delete plugins
  • Theme Management - Install, activate, and delete themes
  • Content Management - Full CRUD for posts, pages, and custom post types
  • Taxonomy Management - Manage categories, tags, and custom taxonomies
  • User Management - Create, update, and manage users
  • Media Management - Upload and manage media files
  • Comments Management - Moderate and manage comments
  • Backup & Restore - Create and restore site backups
  • Health & Diagnostics - Monitor site health and PHP errors
  • Database Maintenance - Optimize, cleanup, and repair database
  • Cache Management - Flush object cache, page cache, and OPcache
  • Settings Management - Read and update WordPress options
  • Meta Management - Manage post, user, and term metadata
  • WooCommerce Integration - Manage products, orders, and reports (if WooCommerce is active)

AI Integration

LW Site Manager is designed for AI agent integration via multiple interfaces:

InterfaceDescription
REST APIAny AI can call abilities via HTTP
MCP AdapterClaude, GPT can use abilities as tools
Agentic LoopsAI decides which abilities to call
+-------------+ MCP +-----------------+ REST +-------------+ | Claude | <----------> | MCP Adapter | <----------> | WordPress | | (AI) | | | | Abilities | +-------------+ +-----------------+ +-------------+

LW Plugin Abilities

LW Site Manager also exposes abilities from other LW plugins when they are active. See each plugin’s documentation for their available abilities.

Authentication

Use WordPress Application Passwords for API authentication:

  1. Go to Users > Your Profile > Application Passwords
  2. Create a new application password
  3. Use Basic Auth with your username and app password
curl -u "username:xxxx-xxxx-xxxx-xxxx" <URL>

REST API Endpoints

OperationEndpoint
List all abilitiesGET /wp-json/wp-abilities/v1/abilities
Get single abilityGET /wp-json/wp-abilities/v1/abilities/{name}
Execute abilityPOST /wp-json/wp-abilities/v1/abilities/{name}/run

Read-only abilities use GET with input[] query parameters. Write abilities use POST with {"input":{...}} JSON body.

Ability Categories

CategoryDescriptionExample Abilities
maintenanceBackup, cache, DB optimizationcreate-backup, flush-cache, optimize-database
diagnosticsHealth check, error loghealth-check, error-log
updatesPlugin/theme/core updatescheck-updates, update-plugin, update-all
pluginsPlugin managementlist-plugins, install-plugin, activate-plugin
themesTheme managementlist-themes, install-theme, activate-theme
usersUser managementlist-users, create-user, update-user
contentPosts, pages, comments, medialist-posts, create-post, list-media
settingsWordPress settingsget-general-settings, update-reading-settings
taxonomiesCategories, tagslist-categories, create-tag
metaPost, user, term metadataget-post-meta, set-user-meta
wc-productsWooCommerce productswc-list-products, wc-create-product
wc-ordersWooCommerce orderswc-list-orders, wc-update-order-status
wc-reportsWooCommerce reportswc-sales-report, wc-top-sellers

Plugin Management Abilities

list-plugins

List all installed plugins.

Method: GET

Input:

FieldTypeDefaultDescription
statusstringallFilter: all, active, inactive

Output:

{ "plugins": [ { "slug": "akismet/akismet.php", "name": "Akismet Anti-spam", "version": "5.6", "author": "Automattic", "active": true } ], "total": 7 }

install-plugin

Install a plugin from WordPress.org.

Method: POST

Input:

FieldTypeRequiredDefaultDescription
slugstringyes-Plugin slug (e.g., hello-dolly)
activatebooleannofalseActivate after installation

activate-plugin / deactivate-plugin

Activate or deactivate a plugin.

Input:

FieldTypeRequiredDescription
pluginstringyesPlugin slug (e.g., hello-dolly/hello.php)

delete-plugin

Delete a plugin.

Input:

FieldTypeRequiredDescription
pluginstringyesPlugin file path (e.g., hello-dolly/hello.php)

update-plugin

Update a single plugin.

Input:

FieldTypeRequiredDescription
pluginstringyesPlugin slug (e.g., classic-editor/classic-editor.php)

Output:

{ "success": true, "message": "Plugin updated successfully: 1.6.6 -> 1.6.7", "old_version": "1.6.6", "new_version": "1.6.7" }

check-updates

Check for available updates (core, plugins, themes).

Input:

FieldTypeDefaultDescription
typestringallall, core, plugins, themes
force_refreshbooleanfalseClear update cache

update-all

Update all plugins and themes at once.

Input:

FieldTypeDefaultDescription
include_corebooleanfalseInclude WordPress core
include_pluginsbooleantrueUpdate plugins
include_themesbooleantrueUpdate themes
stop_on_errorbooleantrueStop on PHP error

Theme Management Abilities

list-themes

List all installed themes.

install-theme

Install a theme from WordPress.org.

Input:

FieldTypeRequiredDefaultDescription
slugstringyes-Theme slug
activatebooleannofalseActivate after install

activate-theme / delete-theme / update-theme

Manage theme lifecycle. Input requires theme (string, theme slug).

Content Abilities - Posts

list-posts

List posts with filtering and pagination.

Input:

FieldTypeDefaultDescription
post_typestringpostPost type
limitinteger20Items (1-100)
offsetinteger0Skip items
statusstringanypublish, draft, pending, trash, any
authorinteger-Author ID
categorystring-Category slug
tagstring-Tag slug
searchstring-Search title/content
date_afterstring-After date (Y-m-d)
date_beforestring-Before date (Y-m-d)
orderbystringdateSort field
orderstringDESCASC, DESC

get-post

Get detailed post information by id or slug.

create-post

Create a new post.

Input:

FieldTypeRequiredDefaultDescription
titlestringyes-Title
contentstringno-Content (HTML)
statusstringnodraftStatus
post_typestringnopostPost type
categoriesarrayno-Category IDs
tagsarrayno-Tag names, slugs or IDs
featured_imageintegerno-Featured image ID
metaobjectno-Custom meta fields
taxonomiesobjectno-Custom taxonomies

update-post

Update a post. Requires id, all other fields optional.

delete-post

Delete a post. Input: id (required), force (boolean, skip trash).

restore-post / duplicate-post / bulk-posts

Additional post operations. bulk-posts accepts ids (array) and action (publish, draft, trash, delete, restore).

get-post-types

List available post types. Filter by public (boolean).

set-post-terms / get-post-terms

Manage taxonomy terms for a post. Supports custom post types and custom taxonomies.

Content Abilities - Pages

list-pages

List pages with filtering. Similar to list-posts but defaults to menu_order sort.

get-page / create-page / update-page / delete-page

Full CRUD for pages. Same structure as post abilities with additional parent, menu_order, and template fields.

page-hierarchy

Get hierarchical page tree.

page-templates

List available page templates.

front-page-settings / set-homepage / set-posts-page

Manage homepage and blog page settings.

restore-page / duplicate-page / reorder-pages / set-page-template

Additional page management operations.

Content Abilities - Comments

list-comments

List comments with filtering.

Input:

FieldTypeDefaultDescription
limitinteger50Items (1-100)
statusstringallall, approve, hold, spam, trash
post_idinteger-Filter by post
searchstring-Search content

get-comment / create-comment / update-comment / delete-comment

Full CRUD for comments.

approve-comment / spam-comment

Quick status actions for comments.

bulk-comments

Bulk operations. Input: ids (array), action (approve, unapprove, spam, trash, delete).

comment-counts

Get comment statistics, optionally filtered by post_id.

Content Abilities - Media

list-media

List media items. Filter by mime_type (e.g., image, video).

get-media

Get detailed media item information including sizes.

upload-media

Upload media from URL or base64 data.

Input:

FieldTypeRequiredDescription
urlstring-Source URL (use EITHER url OR data+filename)
datastring-Base64 encoded file data
filenamestring-Filename with extension (required with data)
titlestringnoMedia title
altstringnoAlt text

update-media / delete-media

Update metadata or delete media items.

Taxonomy Abilities - Categories

list-categories / get-category / create-category / update-category / delete-category

Full CRUD for categories. Supports custom taxonomies via the taxonomy parameter (e.g., product_category).

list-categories Input:

FieldTypeDefaultDescription
taxonomystringcategoryTaxonomy name
limitinteger20Items to return
hide_emptybooleanfalseHide empty categories
searchstring-Search term
parentinteger-Filter by parent
orderbystringnameSort field

Note: The default category (Uncategorized) cannot be deleted. Posts in deleted categories move to default.

Taxonomy Abilities - Tags

list-tags / get-tag / create-tag / update-tag / delete-tag

Full CRUD for tags. Supports custom taxonomies via the taxonomy parameter (e.g., product_tag).

Note: Tags are not hierarchical. Deleted tags are automatically removed from associated posts.

Meta Abilities

Post Meta

AbilityMethodDescription
get-post-metaGETGet post/page metadata
set-post-metaPOSTSet post/page metadata
delete-post-metaDELETEDelete post/page metadata

get-post-meta Input:

FieldTypeRequiredDescription
post_idintegeryesPost or page ID
keystringnoSpecific meta key (returns all if omitted)
include_privatebooleannoInclude private meta keys (starting with _)

User Meta

AbilityMethodDescription
get-user-metaGETGet user metadata
set-user-metaPOSTSet user metadata
delete-user-metaDELETEDelete user metadata

Term Meta

AbilityMethodDescription
get-term-metaGETGet category/tag metadata
set-term-metaPOSTSet category/tag metadata
delete-term-metaDELETEDelete category/tag metadata

Note: Private meta keys (starting with _) are not included by default. Use include_private: true to include them. Meta values can be simple types or complex types (arrays, objects) - WordPress handles serialization automatically.

User Management Abilities

list-users

List users with filtering and pagination.

Input:

FieldTypeDefaultDescription
limitinteger50Items to return
orderbystringregisteredSort: registered, display_name, email, login
rolestring-Filter by role
searchstring-Search username, email, display_name

get-user

Get detailed user information by id, email, or login.

create-user

Create a new user.

Input:

FieldTypeRequiredDefaultDescription
usernamestringyes-Username
emailstringyes-Email address
passwordstringnoauto-generatedPassword
rolestringnosubscriberRole
send_notificationbooleannofalseSend welcome email

Note: The password field is only included in the response if it was auto-generated.

update-user / delete-user

Update user fields or delete a user. Delete supports reassign_to for content reassignment.

reset-password

Reset a user’s password. Identify by id, email, or login.

get-roles

List all available roles with user counts.

Settings Abilities

General Settings

AbilityMethodDescription
get-general-settingsGETSite title, tagline, email, timezone, etc.
update-general-settingsPOSTUpdate general settings

Updatable fields: blogname, blogdescription, admin_email, users_can_register, default_role, timezone_string, date_format, time_format, start_of_week, WPLANG

Note: siteurl and home cannot be modified via API for security reasons.

Reading Settings

AbilityMethodDescription
get-reading-settingsGETPosts per page, RSS, homepage display
update-reading-settingsPOSTUpdate reading settings

Discussion Settings

AbilityMethodDescription
get-discussion-settingsGETComments, pingbacks, moderation, avatars
update-discussion-settingsPOSTUpdate discussion settings
AbilityMethodDescription
get-permalink-settingsGETPermalink structure, category/tag base
update-permalink-settingsPOSTUpdate permalinks (auto-regenerates rewrite rules)

Maintenance Abilities

Backup

AbilityMethodDescription
create-backupPOSTStart async backup job
backup-statusGETGet backup progress
cancel-backupPOSTCancel running backup
list-backupsGETList available backups
restore-backupDELETERestore from backup
delete-backupDELETEDelete a backup file

create-backup Input:

FieldTypeDefaultDescription
include_databasebooleantrueInclude database
include_filesbooleantrueInclude WordPress files

Output:

{ "success": true, "backup_id": "2026-01-13_07-04-13_8fMZyHG8", "status": "pending", "total_files": 6270, "total_size_human": "118 MB", "chunks_total": 13 }

Note: Backups run asynchronously. Use backup-status to track progress. Backups are stored in wp-content/uploads/wpsm-backups/.

Health & Diagnostics

health-check

Run a comprehensive site health check.

Input:

FieldTypeDefaultDescription
include_debugbooleanfalseInclude debug information

Output:

{ "status": "recommended", "score": 87, "issues": [ { "type": "warning", "message": "4 theme update(s) available", "category": "updates" } ], "php_version": "8.1.31", "wp_version": "6.9", "disk_usage": { "total_human": "37 GB", "free_human": "24 GB", "wordpress": { "total": "187 MB" } }, "memory": { "limit": "256 MB", "usage": "8 MB" } }

error-log

Get PHP error log.

Input:

FieldTypeDefaultDescription
linesinteger100Lines to retrieve (max 1000)
filterstring-Filter by keyword
levelstringallall, error, warning, notice

Database

optimize-database

Optimize database tables.

Input: tables (array, optional - all tables if empty)

cleanup-database

Delete revisions, transients, spam and other unnecessary data.

Input:

FieldTypeDefaultDescription
revisionsbooleantrueDelete post revisions
auto_draftsbooleantrueDelete auto-draft posts
trash_postsbooleantrueDelete trashed posts
spam_commentsbooleantrueDelete spam comments
trash_commentsbooleantrueDelete trashed comments
expired_transientsbooleantrueDelete expired transients
all_transientsbooleanfalseDelete all transients

Cache

flush-cache

Flush caches (object cache, page cache, OPcache, plugin caches).

Input:

FieldTypeDefaultDescription
object_cachebooleantrueFlush object cache
page_cachebooleantrueFlush page cache
opcachebooleantrueFlush PHP OPcache
plugin_cachesbooleantrueFlush plugin caches

Plugin Database Updates

AbilityMethodDescription
check-plugin-db-updatesGETCheck for pending DB updates (WooCommerce, Elementor)
update-plugin-dbDELETERun DB update for specific plugin
update-all-plugin-dbsDELETERun all pending DB updates
get-supported-db-pluginsGETList supported plugins for DB updates

WooCommerce Abilities

WooCommerce abilities are only available when WooCommerce is active.

Products

AbilityMethodDescription
wc-list-productsGETList products with filtering
wc-get-productGETGet product details (by id, sku, or slug)
wc-create-productPOSTCreate a product
wc-update-productPOSTUpdate a product
wc-delete-productDELETEDelete a product
wc-duplicate-productPOSTDuplicate a product
wc-update-stockPOSTQuick stock update (set quantity, adjust +/-, or stock_status)
wc-list-product-categoriesGETList product categories
wc-list-variationsGETList variations of a variable product
wc-bulk-productsPOSTBulk operations (publish, draft, trash, delete, restore)

wc-list-products Input:

FieldTypeDefaultDescription
statusstringanypublish, draft, pending, private, trash, any
typestring-simple, variable, grouped, external
categorystring-Category slug or ID
stock_statusstring-instock, outofstock, onbackorder
featuredboolean-Featured products only
on_saleboolean-Products on sale only
searchstring-Search in name
limitinteger20Items (1-100)

Orders

AbilityMethodDescription
wc-list-ordersGETList orders with filtering
wc-get-orderGETGet order details (items, addresses, shipping, coupons)
wc-update-order-statusPOSTChange order status
wc-list-order-statusesGETList available order statuses
wc-create-refundPOSTCreate a refund
wc-list-order-notesGETList order notes
wc-add-order-notePOSTAdd a note to an order
wc-bulk-ordersPOSTBulk status update

wc-update-order-status Input:

FieldTypeRequiredDescription
idintegeryesOrder ID
statusstringyesNew status (e.g., processing, completed)
notestringnoNote for status change

Reports

AbilityMethodDescription
wc-sales-reportGETSales report for a period
wc-top-sellersGETTop-selling products
wc-orders-totalsGETOrder counts by status
wc-revenue-statsGETRevenue with period comparison
wc-low-stock-productsGETLow stock and out of stock products
wc-products-totalsGETProduct counts by status and stock

wc-sales-report Input:

FieldTypeDefaultDescription
periodstringmonthday, week, month, year, last_7_days, last_30_days
date_minstring-Custom start date (Y-m-d)
date_maxstring-Custom end date (Y-m-d)

wc-revenue-stats Input:

FieldTypeDefaultDescription
periodstringlast_7_daystoday, last_7_days, last_30_days, this_month, this_year
comparebooleanfalseCompare with previous period

Output (with comparison):

{ "success": true, "period": "last_7_days", "current": { "revenue": 850.00, "orders": 15, "items_sold": 28 }, "previous": { "revenue": 720.00, "orders": 12, "items_sold": 22 }, "changes": { "revenue": { "value": 130.00, "percentage": 18.06, "trend": "up" }, "orders": { "value": 3, "percentage": 25.00, "trend": "up" } } }

Extending with Custom Abilities

LW Site Manager provides two action hooks that allow any WordPress plugin to register its own abilities and categories.

Hooks

HookWhenParameters
lw_site_manager_register_categoriesDuring category registrationNone
lw_site_manager_register_abilitiesAfter all core abilities are registered$permissions (PermissionManager)

Quick Start

// In your plugin's init or plugins_loaded hook: add_action( 'lw_site_manager_register_categories', function (): void { wp_register_ability_category( 'my-plugin', [ 'label' => __( 'My Plugin', 'my-plugin' ), 'description' => __( 'My plugin management abilities', 'my-plugin' ), ]); }); add_action( 'lw_site_manager_register_abilities', function ( $permissions ): void { wp_register_ability( 'my-plugin/get-status', [ 'label' => __( 'Get Status', 'my-plugin' ), 'description' => __( 'Get current plugin status.', 'my-plugin' ), 'category' => 'my-plugin', 'execute_callback' => [ MyService::class, 'get_status' ], 'permission_callback' => $permissions->callback( 'can_manage_options' ), 'input_schema' => [ 'type' => 'object', 'default' => [], ], 'output_schema' => [ 'type' => 'object', 'properties' => [ 'success' => [ 'type' => 'boolean' ], 'status' => [ 'type' => 'string' ], ], ], 'meta' => [ 'show_in_rest' => true, 'annotations' => [ 'readonly' => true, 'destructive' => false, 'idempotent' => true, ], ], ]); });

Naming Convention

Use your plugin slug as prefix to prevent naming collisions:

my-plugin/get-status my-plugin/set-options lw-seo/get-meta lw-cookie/get-consent

Permission Manager

The $permissions parameter provides these methods:

MethodCapability
can_manage_optionsmanage_options
can_edit_postsedit_posts
can_publish_postspublish_posts
can_delete_postsdelete_posts
can_manage_userslist_users
can_edit_usersedit_users
can_upload_filesupload_files
can_manage_categoriesmanage_categories

You can also use a custom callback:

'permission_callback' => fn() => current_user_can( 'my_custom_capability' ),

Input/Output Schema

Both use JSON Schema format:

'input_schema' => [ 'type' => 'object', 'required' => [ 'post_id' ], 'properties' => [ 'post_id' => [ 'type' => 'integer', 'description' => __( 'The post ID.', 'my-plugin' ), ], ], ],

Execute Callback

A static method that receives array $input and returns array (success) or \WP_Error (failure):

class MyService { public static function get_status( array $input ): array|\WP_Error { if ( empty( $input['post_id'] ) ) { return new \WP_Error( 'missing_id', __( 'Post ID is required.', 'my-plugin' ), [ 'status' => 400 ] ); } $post = get_post( (int) $input['post_id'] ); if ( ! $post ) { return new \WP_Error( 'not_found', __( 'Post not found.', 'my-plugin' ), [ 'status' => 404 ] ); } return [ 'success' => true, 'status' => $post->post_status ]; } }

No Hard Dependency

Your plugin should work even if LW Site Manager is not installed. The hooks simply never fire:

// Safe - these hooks are no-ops if site manager is not active. add_action( 'lw_site_manager_register_categories', [ MyIntegration::class, 'register_category' ] ); add_action( 'lw_site_manager_register_abilities', [ MyIntegration::class, 'register_abilities' ] );
your-plugin/ includes/ SiteManager/ Integration.php # Hook registration + category Abilities.php # wp_register_ability() calls Service.php # Execute callbacks

Real-World Example: LW SEO

includes/SiteManager/ Integration.php # Hook registration SeoAbilities.php # Ability definitions SeoService.php # Execute callbacks

Registered abilities:

AbilityTypeDescription
lw-seo/get-metareadonlyGet SEO meta for a post or term
lw-seo/set-metawriteSet SEO meta (title, description, social, signals)
lw-seo/get-content-signalsreadonlyGet resolved AI content signals
lw-seo/get-markdownreadonlyGet markdown representation of content
lw-seo/get-optionsreadonlyGet global SEO settings

Official Sources

FAQ

What is the WordPress Abilities API?

The WordPress Abilities API is a feature in WordPress 6.9 that allows plugins to register standardized capabilities that can be executed via REST API, PHP, or JavaScript.

How do I authenticate API requests?

Use WordPress Application Passwords. Go to Users > Your Profile > Application Passwords to create one. Then use Basic Auth with your username and app password.

Does this work with WooCommerce?

Yes. When WooCommerce is active, additional abilities for managing products, orders, customers, and reports become available.

How does the HTTP method get determined?

The WordPress Abilities API determines HTTP method based on meta annotations:

  • readonly: true - GET
  • destructive: true, idempotent: true - DELETE
  • otherwise - POST