Connect WordPress to Claude Code

Read and write a WordPress site through its REST API, posts, pages, taxonomy, media, people and comments. Add Toolspoke to Claude Code once and it can use 12 WordPress actions. Your WordPress credential stays in Toolspoke, and you choose which actions Claude Code may call.

Set it up in Claude Code

Three steps, the first one once for every toolkit you will ever add.

  1. Add Toolspoke to Claude Code

    Run it in your project, then /mcp to sign in

    claude mcp add --transport http toolspoke https://toolspoke.com/mcp

    The sign-in opens in your browser, and Toolspoke asks you to approve it.

  2. Install WordPress and connect it

    Add WordPress to a project in your Toolspoke workspace.

    Application password. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.

    Site URL
    The site's own address, e.g. https://example.com, or https://example.com/blog if WordPress is installed under a path. Everything this connector calls hangs off /wp-json/wp/v2 below it. Must be reachable over HTTPS: WordPress refuses application passwords on a plain-HTTP site.
    Username and application password
    The WordPress username (or the account's email address), a colon, then an application password. Create one at wp-admin → Users → Profile → Application Passwords; it is shown once. The spaces WordPress displays are cosmetic and may be kept or removed. Sent as HTTP Basic. The password inherits that user's capabilities exactly, so create it on an account with only the roles this connection should have, an Editor can publish, an Author cannot touch other people's posts, a Subscriber can read.
  3. Choose what Claude Code may do

    All 12 actions start on. Switch off any of the 3 actions that change something in WordPress, and Claude Code gets a refusal if it tries.

What you can ask Claude Code for

A few of the WordPress actions that only read, so they are safe to try first.

  • List posts, newest first
  • Read one post by its numeric id, with the whole body
  • List pages, the site's standing content, as opposed to its posts
  • Read one page by its numeric id, with the whole body

What Claude Code can do in WordPress

9 actions read and 3 delete or permanently change something.

Reads

  • List posts

    List posts, newest first. Defaults to published posts only, pass `status` to see drafts, pending or private ones, which needs a credential allowed to edit them. `search` does a full-text match; `categories` and `tags` take term ids from list_categories and list_tags, not names. Content comes back as objects rather than strings: `title.rendered`, `content.rendered` and `excerpt.rendered` hold the HTML a visitor would see, and `content.raw` appears only when `context` is edit. Free. WordPress bills nothing; the only limit is the site's own hosting. The bodies are the site's published writing, so the payload is kept out of the audit log.

  • Get post

    Read one post by its numeric id, with the whole body. Free. `title.rendered` and `content.rendered` carry the HTML a visitor sees; pass `context: "edit"` to also get `content.raw`, the block markup an editor would work with, which is what update_post expects back. A password-protected post returns an empty `content.rendered` and `protected: true` unless the post's password is supplied. The body is the site's published writing, so the payload is kept out of the audit log.

  • List pages

    List pages, the site's standing content, as opposed to its posts. Free. Pages are hierarchical, so `parent` narrows to the children of one page and `menu_order` is the field a theme sorts navigation by; neither exists on posts. There are no categories or tags here and no sticky flag. Defaults to published pages only. The bodies are the site's own writing, so the payload is kept out of the audit log.

  • Get page

    Read one page by its numeric id, with the whole body. Free. Same shape as get_post, `title.rendered` and `content.rendered` hold the HTML a visitor sees, `context: "edit"` adds the raw block markup. `parent` and `menu_order` say where the page sits in the site's hierarchy and menus. The body is the site's own writing, so the payload is kept out of the audit log.

  • List categories

    List the site's categories with their ids, names, slugs, parents and post counts. Free. The ids are what list_posts filters by and what create_post assigns, a category name passed to either is ignored, silently, which is the most common way a post ends up uncategorised. Categories are hierarchical, so `parent` narrows to one branch; there is no `offset` here, because WordPress swaps `offset` for `parent` on hierarchical taxonomies. This is the connection test: it needs no arguments, returns the site's own taxonomy rather than anybody's writing, costs nothing, and proves three things at once, that the site URL is right, that WordPress is answering on /wp-json, and that the application password was accepted, since a rejected one fails every request including this.

  • List tags

    List the site's tags with their ids, names, slugs and post counts. Free. Same role as list_categories: the ids are what list_posts filters by and create_post assigns, and a tag name passed instead of an id is ignored. Tags are flat rather than hierarchical, which is why this endpoint has `offset` and no `parent`, the mirror image of categories.

  • List media

    List items in the media library, images, video, audio and documents, with their attachment ids, source URLs, alt text, captions and generated size variants. Free. The `id` values are what create_post's `featured_media` takes. Note that media uses `status: "inherit"` by default rather than "publish", which is WordPress's own convention for attachments; `media_type` and `mime_type` are the useful filters. Uploading is not offered here: it needs a raw binary body with a Content-Disposition filename, which this connector cannot send. Alt text and captions are somebody's writing about somebody's pictures, so the payload is kept out of the audit log.

  • List users

    List the site's users, the people who write it. Free. What comes back depends entirely on the credential: an account without the list_users capability silently gets only users who have published something, in view context, with no email addresses and no roles; an administrator gets everyone, and `context: "edit"` adds email, roles and capabilities. Several filters are refused rather than ignored without that capability, `roles`, `capabilities`, and ordering by email or registration date each fail with their own error. The ids are what list_posts and create_post use to name an author. These are real people's names and, in edit context, their email addresses, so the payload is kept out of the audit log.

  • List comments

    List comments, newest first, approved ones by default. Free. `post` narrows to one post's thread and `parent` to the replies under one comment. The filters `status`, `type`, `author`, `author_exclude` and `author_email` all require a credential allowed to moderate, without it they are refused rather than ignored, which is the usual reason a call for pending comments comes back empty-looking. These are things members of the public wrote, under their own names and with their email addresses attached in edit context, so the payload is kept out of the audit log.

Deletes or permanently changes

  • Create post

    Create a post. Classified destructive rather than write because of one argument: `status: "publish"` puts the text on a public website, sends it to feed readers and subscribers, and cannot be quietly undone, reverting it to draft afterwards does not recall what was already fetched. A read-and-write grant must not be able to do that, so the whole operation is gated by its most dangerous reachable outcome even though most calls to it will be harmless drafts. This connector sends `status: "draft"` when nobody chose, which is also WordPress's own default, so the safe outcome is what happens by accident. `content` is HTML or block markup; `title` and `excerpt` are plain text. `categories` and `tags` take term ids from list_categories and list_tags, never names, a name is silently ignored. Free. The text is the caller's own writing and the response echoes it, so neither is written to the audit log.

  • Update post

    Change an existing post. Destructive for two reasons, and both matter. Passing `status: "publish"` on a draft publishes it, which is the same irreversible step create_post is gated for; and every field named here replaces what was there, with no version this API can restore. WordPress keeps revisions in its own database but exposes no way to roll one back from wp/v2. Pass only the fields to change; anything omitted is left alone, and `status` in particular is never defaulted here, because defaulting it would silently unpublish a live post. Read the post with get_post and `context: "edit"` first to see the raw block markup you are replacing. WordPress documents POST for updates and also accepts PUT and PATCH. Free. The text is the caller's own writing, so neither the arguments nor the response are written to the audit log.

  • Create comment

    Leave a comment on a post. Classified destructive for the same reason gmail.json classifies sending a message that way: it is published under the site's name where the public can read it, and WordPress emails the post's author about it. Deleting the comment afterwards does not unsend the notification and does not recall what anybody already read. A credential with the moderate_comments capability produces an approved, immediately visible comment; without it the comment lands in the moderation queue instead, but the connector cannot know which, so it is gated by the more dangerous outcome. `post` is the id of the post being commented on and is what makes the call work at all; without it WordPress has nothing to attach the comment to. `status` is honoured only for a credential that can moderate. Free. The comment text and the commenter's name and email are prose and personal data, so neither the arguments nor the response are written to the audit log.

WordPress in Claude Code: questions

Does Claude Code see my WordPress credential?

No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.

Can I stop Claude Code from changing things in WordPress?

Yes. Each of the 12 actions can be switched off for a project. Turn off the 3 that change something and Claude Code can only read.

Will 12 actions crowd Claude Code's context?

No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the WordPress action it needs when it needs it. Adding more toolkits does not add more tools to its list.

Can I add it once for every project?

Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.

What does it cost?

Tool calls are free on every plan, and a WordPress call does not run in a sandbox, so it bills nothing.

Try WordPress in Claude Code

Free to start, and tool calls cost nothing on any plan.