This document provides detailed documentation for all the tools available in the WordPress MCP Server.
- Site Management Tools
- Content Management Tools
- User Management Tools
- Taxonomy Management Tools
- Custom Post Types Tools
- Plugin Management Tools
- Theme Management Tools
Add a new WordPress site to the server.
Parameters:
name(string, required): Name of the siteurl(string, required): URL of the WordPress siteusername(string, required): WordPress usernameapplicationPassword(string, required): WordPress application passwordvalidate(boolean, optional): Whether to validate the site credentials (default: true)
Example:
{
"name": "My WordPress Site",
"url": "https://example.com",
"username": "admin",
"applicationPassword": "XXXX XXXX XXXX XXXX XXXX XXXX"
}Response:
{
"status": "success",
"message": "Site added successfully",
"site": {
"id": "site-1",
"name": "My WordPress Site",
"url": "https://example.com",
"username": "admin"
}
}List all WordPress sites.
Parameters:
includeCredentials(boolean, optional): Whether to include credentials in the response (default: false)
Example:
{
"includeCredentials": false
}Response:
{
"status": "success",
"sites": [
{
"id": "site-1",
"name": "My WordPress Site",
"url": "https://example.com",
"username": "admin"
}
]
}Get a WordPress site by ID or name.
Parameters:
id(string, optional): Site IDname(string, optional): Site nameincludeCredentials(boolean, optional): Whether to include credentials in the response (default: false)
Example:
{
"id": "site-1"
}Response:
{
"status": "success",
"site": {
"id": "site-1",
"name": "My WordPress Site",
"url": "https://example.com",
"username": "admin"
}
}Update a WordPress site.
Parameters:
id(string, required): Site IDname(string, optional): Site nameurl(string, optional): Site URLusername(string, optional): WordPress usernameapplicationPassword(string, optional): WordPress application passwordvalidate(boolean, optional): Whether to validate the site credentials (default: true)
Example:
{
"id": "site-1",
"name": "Updated Site Name"
}Response:
{
"status": "success",
"message": "Site updated successfully",
"site": {
"id": "site-1",
"name": "Updated Site Name",
"url": "https://example.com",
"username": "admin"
}
}Remove a WordPress site.
Parameters:
id(string, required): Site ID
Example:
{
"id": "site-1"
}Response:
{
"status": "success",
"message": "Site removed successfully"
}Select a WordPress site as the active site.
Parameters:
id(string, required): Site ID
Example:
{
"id": "site-1"
}Response:
{
"status": "success",
"message": "Site selected successfully",
"site": {
"id": "site-1",
"name": "My WordPress Site",
"url": "https://example.com",
"username": "admin"
}
}Get the active WordPress site.
Parameters:
includeCredentials(boolean, optional): Whether to include credentials in the response (default: false)
Example:
{
"includeCredentials": false
}Response:
{
"status": "success",
"site": {
"id": "site-1",
"name": "My WordPress Site",
"url": "https://example.com",
"username": "admin"
}
}Test connectivity to a WordPress site.
Parameters:
id(string, required): Site ID
Example:
{
"id": "site-1"
}Response:
{
"status": "success",
"message": "Site is reachable",
"site": {
"id": "site-1",
"name": "My WordPress Site",
"url": "https://example.com",
"username": "admin"
}
}Get information about a WordPress site.
Parameters:
id(string, required): Site ID
Example:
{
"id": "site-1"
}Response:
{
"status": "success",
"site_info": {
"name": "My WordPress Site",
"description": "Just another WordPress site",
"url": "https://example.com",
"home": "https://example.com",
"gmt_offset": "0",
"timezone_string": "UTC",
"language": "en-US",
"wordpress_version": "6.2.2",
"permalink_structure": "/%postname%/",
"is_multisite": false
}
}List posts with filtering and pagination.
Parameters:
site_id(string, optional): Site ID (defaults to active site)per_page(integer, optional): Number of posts per page (default: 10)page(integer, optional): Page number (default: 1)status(string, optional): Post status (default: "publish")search(string, optional): Search termauthor(integer, optional): Author IDcategories(array, optional): Category IDstags(array, optional): Tag IDsorder(string, optional): Order ("asc" or "desc", default: "desc")orderby(string, optional): Order by field (default: "date")
Example:
{
"per_page": 5,
"page": 1,
"status": "publish",
"orderby": "title",
"order": "asc"
}Response:
{
"status": "success",
"count": 5,
"total": 25,
"pages": 5,
"posts": [
{
"id": 1,
"title": {
"rendered": "Hello World"
},
"content": {
"rendered": "<p>Welcome to WordPress!</p>"
},
"excerpt": {
"rendered": "<p>Welcome to WordPress!</p>"
},
"status": "publish",
"date": "2023-01-01T12:00:00",
"modified": "2023-01-01T12:00:00",
"author": 1,
"featured_media": 0,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"format": "standard",
"categories": [1],
"tags": []
},
// ... more posts
]
}Get a post by ID.
Parameters:
site_id(string, optional): Site ID (defaults to active site)post_id(integer, required): Post ID
Example:
{
"post_id": 1
}Response:
{
"status": "success",
"post": {
"id": 1,
"title": {
"rendered": "Hello World"
},
"content": {
"rendered": "<p>Welcome to WordPress!</p>"
},
"excerpt": {
"rendered": "<p>Welcome to WordPress!</p>"
},
"status": "publish",
"date": "2023-01-01T12:00:00",
"modified": "2023-01-01T12:00:00",
"author": 1,
"featured_media": 0,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"format": "standard",
"categories": [1],
"tags": []
}
}Create a new post.
Parameters:
site_id(string, optional): Site ID (defaults to active site)title(string, required): Post titlecontent(string, optional): Post contentexcerpt(string, optional): Post excerptstatus(string, optional): Post status (default: "draft")author(integer, optional): Author IDfeatured_media(integer, optional): Featured media IDcomment_status(string, optional): Comment status ("open" or "closed")ping_status(string, optional): Ping status ("open" or "closed")format(string, optional): Post formatsticky(boolean, optional): Whether the post is stickycategories(array, optional): Category IDstags(array, optional): Tag IDs
Example:
{
"title": "My New Post",
"content": "This is the content of my new post.",
"excerpt": "This is the excerpt of my new post.",
"status": "publish",
"categories": [1, 2],
"tags": [3, 4]
}Response:
{
"status": "success",
"message": "Post created successfully",
"post": {
"id": 2,
"title": {
"rendered": "My New Post"
},
"content": {
"rendered": "<p>This is the content of my new post.</p>"
},
"excerpt": {
"rendered": "<p>This is the excerpt of my new post.</p>"
},
"status": "publish",
"date": "2023-01-02T12:00:00",
"modified": "2023-01-02T12:00:00",
"author": 1,
"featured_media": 0,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"format": "standard",
"categories": [1, 2],
"tags": [3, 4]
}
}Update an existing post.
Parameters:
site_id(string, optional): Site ID (defaults to active site)post_id(integer, required): Post IDtitle(string, optional): Post titlecontent(string, optional): Post contentexcerpt(string, optional): Post excerptstatus(string, optional): Post statusauthor(integer, optional): Author IDfeatured_media(integer, optional): Featured media IDcomment_status(string, optional): Comment status ("open" or "closed")ping_status(string, optional): Ping status ("open" or "closed")format(string, optional): Post formatsticky(boolean, optional): Whether the post is stickycategories(array, optional): Category IDstags(array, optional): Tag IDs
Example:
{
"post_id": 2,
"title": "Updated Post Title",
"content": "This is the updated content."
}Response:
{
"status": "success",
"message": "Post updated successfully",
"post": {
"id": 2,
"title": {
"rendered": "Updated Post Title"
},
"content": {
"rendered": "<p>This is the updated content.</p>"
},
"excerpt": {
"rendered": "<p>This is the excerpt of my new post.</p>"
},
"status": "publish",
"date": "2023-01-02T12:00:00",
"modified": "2023-01-02T13:00:00",
"author": 1,
"featured_media": 0,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"format": "standard",
"categories": [1, 2],
"tags": [3, 4]
}
}Delete a post.
Parameters:
site_id(string, optional): Site ID (defaults to active site)post_id(integer, required): Post IDforce(boolean, optional): Whether to bypass trash and force deletion (default: false)
Example:
{
"post_id": 2,
"force": true
}Response:
{
"status": "success",
"message": "Post deleted successfully",
"post": {
"id": 2,
"title": {
"rendered": "Updated Post Title"
},
"status": "trash"
}
}List pages with filtering and pagination.
Parameters:
site_id(string, optional): Site ID (defaults to active site)per_page(integer, optional): Number of pages per page (default: 10)page(integer, optional): Page number (default: 1)status(string, optional): Page status (default: "publish")search(string, optional): Search termauthor(integer, optional): Author IDparent(integer, optional): Parent page IDorder(string, optional): Order ("asc" or "desc", default: "desc")orderby(string, optional): Order by field (default: "date")
Example:
{
"per_page": 5,
"page": 1,
"status": "publish",
"orderby": "title",
"order": "asc"
}Response:
{
"status": "success",
"count": 3,
"total": 3,
"pages": 1,
"pages_data": [
{
"id": 2,
"title": {
"rendered": "About"
},
"content": {
"rendered": "<p>This is the about page.</p>"
},
"excerpt": {
"rendered": "<p>This is the about page.</p>"
},
"status": "publish",
"date": "2023-01-01T12:00:00",
"modified": "2023-01-01T12:00:00",
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 0,
"comment_status": "closed",
"ping_status": "closed",
"template": ""
},
// ... more pages
]
}Get a page by ID.
Parameters:
site_id(string, optional): Site ID (defaults to active site)page_id(integer, required): Page ID
Example:
{
"page_id": 2
}Response:
{
"status": "success",
"page": {
"id": 2,
"title": {
"rendered": "About"
},
"content": {
"rendered": "<p>This is the about page.</p>"
},
"excerpt": {
"rendered": "<p>This is the about page.</p>"
},
"status": "publish",
"date": "2023-01-01T12:00:00",
"modified": "2023-01-01T12:00:00",
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 0,
"comment_status": "closed",
"ping_status": "closed",
"template": ""
}
}Create a new page.
Parameters:
site_id(string, optional): Site ID (defaults to active site)title(string, required): Page titlecontent(string, optional): Page contentexcerpt(string, optional): Page excerptstatus(string, optional): Page status (default: "draft")author(integer, optional): Author IDfeatured_media(integer, optional): Featured media IDparent(integer, optional): Parent page IDmenu_order(integer, optional): Menu ordercomment_status(string, optional): Comment status ("open" or "closed")ping_status(string, optional): Ping status ("open" or "closed")template(string, optional): Page template
Example:
{
"title": "Contact",
"content": "This is the contact page.",
"status": "publish",
"parent": 0
}Response:
{
"status": "success",
"message": "Page created successfully",
"page": {
"id": 3,
"title": {
"rendered": "Contact"
},
"content": {
"rendered": "<p>This is the contact page.</p>"
},
"excerpt": {
"rendered": "<p>This is the contact page.</p>"
},
"status": "publish",
"date": "2023-01-03T12:00:00",
"modified": "2023-01-03T12:00:00",
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 0,
"comment_status": "closed",
"ping_status": "closed",
"template": ""
}
}Update an existing page.
Parameters:
site_id(string, optional): Site ID (defaults to active site)page_id(integer, required): Page IDtitle(string, optional): Page titlecontent(string, optional): Page contentexcerpt(string, optional): Page excerptstatus(string, optional): Page statusauthor(integer, optional): Author IDfeatured_media(integer, optional): Featured media IDparent(integer, optional): Parent page IDmenu_order(integer, optional): Menu ordercomment_status(string, optional): Comment status ("open" or "closed")ping_status(string, optional): Ping status ("open" or "closed")template(string, optional): Page template
Example:
{
"page_id": 3,
"title": "Updated Contact Page",
"content": "This is the updated contact page."
}Response:
{
"status": "success",
"message": "Page updated successfully",
"page": {
"id": 3,
"title": {
"rendered": "Updated Contact Page"
},
"content": {
"rendered": "<p>This is the updated contact page.</p>"
},
"excerpt": {
"rendered": "<p>This is the contact page.</p>"
},
"status": "publish",
"date": "2023-01-03T12:00:00",
"modified": "2023-01-03T13:00:00",
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 0,
"comment_status": "closed",
"ping_status": "closed",
"template": ""
}
}Delete a page.
Parameters:
site_id(string, optional): Site ID (defaults to active site)page_id(integer, required): Page IDforce(boolean, optional): Whether to bypass trash and force deletion (default: false)
Example:
{
"page_id": 3,
"force": true
}Response:
{
"status": "success",
"message": "Page deleted successfully",
"page": {
"id": 3,
"title": {
"rendered": "Updated Contact Page"
},
"status": "trash"
}
}List media items with filtering and pagination.
Parameters:
site_id(string, optional): Site ID (defaults to active site)per_page(integer, optional): Number of media items per page (default: 10)page(integer, optional): Page number (default: 1)search(string, optional): Search termauthor(integer, optional): Author IDmedia_type(string, optional): Media type (e.g., "image", "video", "audio")mime_type(string, optional): MIME type (e.g., "image/jpeg", "video/mp4")order(string, optional): Order ("asc" or "desc", default: "desc")orderby(string, optional): Order by field (default: "date")
Example:
{
"per_page": 5,
"page": 1,
"media_type": "image",
"orderby": "title",
"order": "asc"
}Response:
{
"status": "success",
"count": 3,
"total": 3,
"pages": 1,
"media": [
{
"id": 10,
"date": "2023-01-01T12:00:00",
"date_gmt": "2023-01-01T12:00:00",
"guid": {
"rendered": "https://example.com/wp-content/uploads/2023/01/image1.jpg"
},
"modified": "2023-01-01T12:00:00",
"modified_gmt": "2023-01-01T12:00:00",
"slug": "image1",
"status": "inherit",
"type": "attachment",
"link": "https://example.com/image1/",
"title": {
"rendered": "Image 1"
},
"author": 1,
"comment_status": "open",
"ping_status": "closed",
"template": "",
"meta": [],
"description": {
"rendered": "<p>This is image 1.</p>"
},
"caption": {
"rendered": "<p>Caption for image 1.</p>"
},
"alt_text": "Alt text for image 1",
"media_type": "image",
"mime_type": "image/jpeg",
"media_details": {
"width": 1920,
"height": 1080,
"file": "2023/01/image1.jpg",
"sizes": {
"thumbnail": {
"file": "image1-150x150.jpg",
"width": 150,
"height": 150,
"mime_type": "image/jpeg",
"source_url": "https://example.com/wp-content/uploads/2023/01/image1-150x150.jpg"
},
"medium": {
"file": "image1-300x169.jpg",
"width": 300,
"height": 169,
"mime_type": "image/jpeg",
"source_url": "https://example.com/wp-content/uploads/2023/01/image1-300x169.jpg"
},
"large": {
"file": "image1-1024x576.jpg",
"width": 1024,
"height": 576,
"mime_type": "image/jpeg",
"source_url": "https://example.com/wp-content/uploads/2023/01/image1-1024x576.jpg"
},
"full": {
"file": "image1.jpg",
"width": 1920,
"height": 1080,
"mime_type": "image/jpeg",
"source_url": "https://example.com/wp-content/uploads/2023/01/image1.jpg"
}
}
},
"source_url": "https://example.com/wp-content/uploads/2023/01/image1.jpg"
},
// ... more media items
]
}Get a media item by ID.
Parameters:
site_id(string, optional): Site ID (defaults to active site)media_id(integer, required): Media ID
Example:
{
"media_id": 10
}Response:
{
"status": "success",
"media": {
"id": 10,
"date": "2023-01-01T12:00:00",
"date_gmt": "2023-01-01T12:00:00",
"guid": {
"rendered": "https://example.com/wp-content/uploads/2023/01/image1.jpg"
},
"modified": "2023-01-01T12:00:00",
"modified_gmt": "2023-01-01T12:00:00",
"slug": "image1",
"status": "inherit",
"type": "attachment",
"link": "https://example.com/image1/",
"title": {
"rendered": "Image 1"
},
"author": 1,
"comment_status": "open",
"ping_status": "closed",
"template": "",
"meta": [],
"description": {
"rendered": "<p>This is image 1.</p>"
},
"caption": {
"rendered": "<p>Caption for image 1.</p>"
},
"alt_text": "Alt text for image 1",
"media_type": "image",
"mime_type": "image/jpeg",
"media_details": {
"width": 1920,
"height": 1080,
"file": "2023/01/image1.jpg",
"sizes": {
"thumbnail": {
"file": "image1-150x150.jpg",
"width": 150,
"height": 150,
"mime_type": "image/jpeg",
"source_url": "https://example.com/wp-content/uploads/2023/01/image1-150x150.jpg"
},
"medium": {
"file": "image1-300x169.jpg",
"width": 300,
"height": 169,
"mime_type": "image/jpeg",
"source_url": "https://example.com/wp-content/uploads/2023/01/image1-300x169.jpg"
},
"large": {
"file": "image1-1024x576.jpg",
"width": 1024,
"height": 576,
"mime_type": "image/jpeg",
"source_url": "https://example.com/wp-content/uploads/2023/01/image1-1024x576.jpg"
},
"full": {
"file": "image1.jpg",
"width": 1920,
"height": 1080,
"mime_type": "image/jpeg",
"source_url": "https://example.com/wp-content/uploads/2023/01/image1.jpg"
}
}
},
"source_url": "https://example.com/wp-content/uploads/2023/01/image1.jpg"
}
}Upload a media file.
Parameters:
site_id(string, optional): Site ID (defaults to active site)file_path(string, required): Path to the file to uploadtitle(string, optional): Media titlealt_text(string, optional): Alt textcaption(string, optional): Captiondescription(string, optional): Description
Example:
{
"file_path": "/path/to/image.jpg",
"title": "My Image",
"alt_text": "A beautiful image"
}Response:
{
"status": "success",
"message": "Media uploaded successfully",
"media": {
"id": 11,
"date": "2023-01-04T12:00:00",
"date_gmt": "2023-01-04T12:00:00",
"guid": {
"rendered": "https://example.com/wp-content/uploads/2023/01/image.jpg"
},
"modified": "2023-01-04T12:00:00",
"modified_gmt": "2023-01-04T12:00:00",
"slug": "image",
"status": "inherit",
"type": "attachment",
"link": "https://example.com/image/",
"title": {
"rendered": "My Image"
},
"author": 1,
"comment_status": "open",
"ping_status": "closed",
"template": "",
"meta": [],
"description": {
"rendered": ""
},
"caption": {
"rendered": ""
},
"alt_text": "A beautiful image",
"media_type": "image",
"mime_type": "image/jpeg",
"media_details": {
"width": 1920,
"height": 1080,
"file": "2023/01/image.jpg",
"sizes": {
"thumbnail": {
"file": "image-150x150.jpg",
"width": 150,
"height": 150,
"mime_type": "image/jpeg",
"source_url": "https://example.com/wp-content/uploads/2023/01/image-150x150.jpg"
},
"medium": {
"file": "image-300x169.jpg",
"width": 300,
"height": 169,
"mime_type": "image/jpeg",
"source_url": "https://