wp_delete_application_password
Revoke an existing WordPress application password by specifying the user ID and password UUID to remove API access securely.
Instructions
Revokes an existing application password.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | The ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured. | |
| user_id | Yes | The ID of the user who owns the password. | |
| uuid | Yes | The UUID of the application password to revoke. |
Implementation Reference
- src/tools/site.ts:261-272 (handler)MCP tool handler: extracts user_id and uuid parameters, calls WordPressClient.deleteApplicationPassword(), returns success message or throws formatted error.public async handleDeleteApplicationPassword( client: WordPressClient, params: Record<string, unknown>, ): Promise<unknown> { try { const { user_id, uuid } = params as { user_id: number; uuid: string }; await client.deleteApplicationPassword(user_id, uuid); return `✅ Application password with UUID ${uuid} has been revoked.`; } catch (_error) { throw new Error(`Failed to delete application password: ${getErrorMessage(_error)}`); } }
- src/tools/site.ts:114-132 (registration)Tool registration entry in SiteTools.getTools(): specifies name, description, input schema (parameters), and binds the handler function.{ name: "wp_delete_application_password", description: "Revokes an existing application password.", parameters: [ { name: "user_id", type: "number", required: true, description: "The ID of the user who owns the password.", }, { name: "uuid", type: "string", required: true, description: "The UUID of the application password to revoke.", }, ], handler: this.handleDeleteApplicationPassword.bind(this), },
- src/client/operations/site.ts:73-75 (helper)Low-level API implementation in SiteOperations: constructs WP REST API DELETE endpoint and executes the request via the HTTP client.async deleteApplicationPassword(userId: number | "me", uuid: string): Promise<{ deleted: boolean }> { return this.client.delete(`users/${userId}/application-passwords/${uuid}`); }