wordpress_publish
Publish a page to WordPress asynchronously. Preserves original URL with Web Resurrect plugin and automatically pushes URL mappings.
Instructions
Publish a page to WordPress. Async operation, returns a job_id. Free (no credit cost). When using the Web Resurrect plugin, the original URL is preserved (e.g. /chaussures/basket-rouge.html serves the post directly at that URL, no redirect). URL mappings are pushed automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_id | Yes | Page UUID to publish | |
| wordpress_domain | Yes | Target WordPress domain | |
| category_id | No | WordPress category ID | |
| author_id | No | WordPress author ID | |
| post_type | No | WordPress post type (default: post) | |
| status | No | Publish status (default: draft) | |
| use_rewritten_content | No | Use rewritten content if available (default: true) | |
| remove_links | No | Remove links from content (default: false) |
Implementation Reference
- src/tools.ts:590-611 (registration)MCP tool registration for 'wordpress_publish' with Zod schema and handler defined via server.tool()
server.tool( "wordpress_publish", "Publish a page to WordPress. Async — returns a job_id. Free (no credit cost). In plugin mode the original URL is preserved (no redirect) and the URL mapping is pushed automatically.", { page_id: z.string().uuid().describe("Page UUID to publish"), wordpress_domain: z.string().describe("Target WordPress domain"), category_id: z.number().int().optional().describe("WordPress category ID (overrides mapping)"), author_id: z.number().int().optional().describe("WordPress author ID (overrides mapping)"), post_type: z.enum(["post", "page"]).optional().describe("WordPress post type (default: post)"), status: z.enum(["draft", "publish"]).optional().describe("Publish status (default: draft)"), use_rewritten_content: z .boolean() .optional() .describe("Use rewritten content if available (default: true)"), remove_links: z.boolean().optional().describe("Remove links from content (default: false)"), }, { title: "Publish to WordPress", openWorldHint: true }, withErrors(async (args) => { const res = await client.wordpressPublish(args); return json(res.data); }) ); - src/tools.ts:593-604 (schema)Zod input schema for wordpress_publish: page_id (UUID), wordpress_domain (string), optional category_id, author_id, post_type, status, use_rewritten_content, remove_links
{ page_id: z.string().uuid().describe("Page UUID to publish"), wordpress_domain: z.string().describe("Target WordPress domain"), category_id: z.number().int().optional().describe("WordPress category ID (overrides mapping)"), author_id: z.number().int().optional().describe("WordPress author ID (overrides mapping)"), post_type: z.enum(["post", "page"]).optional().describe("WordPress post type (default: post)"), status: z.enum(["draft", "publish"]).optional().describe("Publish status (default: draft)"), use_rewritten_content: z .boolean() .optional() .describe("Use rewritten content if available (default: true)"), remove_links: z.boolean().optional().describe("Remove links from content (default: false)"), - src/tools.ts:607-610 (handler)Handler function that calls client.wordpressPublish(args) and returns JSON result, wrapped with error handling
withErrors(async (args) => { const res = await client.wordpressPublish(args); return json(res.data); }) - src/client.ts:413-424 (handler)HTTP client method wordpressPublish — sends POST request to /api/v1/wordpress/publish with all opts, returns AsyncJobResponse
async wordpressPublish(opts: { page_id: string; wordpress_domain: string; category_id?: number; author_id?: number; post_type?: string; status?: string; use_rewritten_content?: boolean; remove_links?: boolean; }): Promise<ApiResponse<AsyncJobResponse>> { return this.request("POST", "/api/v1/wordpress/publish", opts as Record<string, unknown>); } - src/client.ts:89-94 (helper)AsyncJobResponse interface used as the return type for wordpressPublish: job_id, status, page_id, credits_used
export interface AsyncJobResponse { job_id: string; status: string; page_id?: string; credits_used?: number; }