Skip to main content
Halloween offer Extra 25% hosting credits when you buy on $100+ in credits
Take my treat →Claim
Agency Program 50% cashback. Exclusive discounts. Priority support. Built for growing agencies. 50% cashback. Exclusive discounts. Priority support. Built for growing agencies. Speak to the team Join free

How to Use Claude Code for WordPress: Connect, Build and Deploy

A hands-on guide to using Claude Code with WordPress: connect your site over MCP in one command, edit theme and plugin code, build a plugin, and ship WooCommerce changes through staging without putting live orders at risk.

NS
Neha Sharma
Content, InstaWP
Updated Oct 27, 2026 36 min read

Claude Code works on a WordPress site in two ways: as an MCP client that reads and changes the site through a WordPress MCP server, and as a terminal agent that edits theme and plugin code over SSH, SFTP and WP-CLI. Connect it with one claude mcp add --transport http command, do the work on a staging copy, and let a person push the result to production.

InstaWP, managed WordPress hosting that is ready for AI agents, ran every step in this guide with Claude Code 2.1.282 between 9 and 26 October 2026. That covers connecting it to InstaMCP sandboxes, giving it a scoped token on a WooCommerce store’s staging copy, and having it write a plugin that was then tested on a throwaway WordPress 7.1 install. The numbers, screenshots and failures below come from those runs.

Key takeaways
  • One command connects them: claude mcp add --transport http, followed by a name for your site, its MCP address and your token in an Authorization header. On an InstaWP site, the Add to Claude Code button types the command in for you.
  • Or skip the token with the Claude directory: InstaWP is listed in the Claude connector directory. Add it once on claude.ai, sign in with InstaWP, and Claude Code picks it up when you log in with the same Claude subscription.
  • Pick the right MCP server: InstaWP’s Account MCP manages your sites from the outside (create, back up, PHP and WordPress versions). InstaMCP works inside one site, with 43 tools for posts, blocks, plugins and media.
  • Use MCP for the site and the terminal for the code: theme and plugin files, tests and deploys go over SSH, WP-CLI and Git. Most real jobs use both.
  • Check the site, not the summary: Claude Code wrote a working plugin in 22.8 seconds for $0.18, but its readme said “Tested up to: 6.8”. In another test it reported five plugin updates, and only one had actually happened.
  • WooCommerce changes go through staging: a staging push replaces the live database, so orders placed since the last copy would be lost. Push code, and redo content and settings changes on the live store.
QuestionAnswer (tested October 2026)
What Claude Code isAnthropic’s agentic coding tool. It runs in your terminal, reads your project, runs commands and edits files after you approve them.
How it reaches WordPressOver MCP (the Model Context Protocol) for site content and settings, and over SSH, SFTP, WP-CLI or Git for code and files.
Connect commandclaude mcp add --transport http <name> <url> --header "Authorization: Bearer <token>"
Tools it gets on an InstaWP site43 InstaMCP tools. Three power tools (execute_php, db_query, site_files) stay off until a site admin enables them.
What you needA paid Claude plan (Pro, Max, Team or Enterprise) or a Claude Console account, and a WordPress site with an MCP server. InstaMCP needs an InstaWP Sandbox plan or above.
Plugin build, measuredOne prompt, 4 tool calls, 22.8 seconds, $0.18. Worked on WordPress 7.1 and PHP 8.2.
Scoped accessCreate a token for an Editor user with an expiry. In InstaWP’s test, plugin updates were then refused with “requires the ‘mcp:admin’ scope”.
WooCommerce deploysStaging first. A push replaces the live database, so replay data changes on live instead of pushing them.
RollbackInstaMCP keeps a backup of each plugin file it writes. Site backups and instawp versions cover the rest.
Do notCommit a token in .mcp.json, or run Claude Code against a live store with Safe Mode off and every tool pre-approved.

Read the table top to bottom as the order of work: connect (rows 2 to 5), build (row 6), then lock down and ship (rows 7 to 10). The rest of the guide follows that order, with a section for each.

Give Claude Code a WordPress site to work onAn InstaWP sandbox comes with InstaMCP, SSH and WP-CLI ready, and an Add to Claude Code button on its MCP tab.
Create a free sandbox →

What is Claude Code, and what can it do on a WordPress site?

Claude Code is Anthropic’s command-line coding agent: you describe a task, and it reads files, runs shell commands and calls MCP tools until the task is done, asking before each action you have not pre-approved. On a WordPress site it can write and edit content, change settings and SEO fields, install and update plugins, edit theme and plugin code, run WP-CLI and read error logs. It is not the Claude chat app: the app talks to WordPress only through a connector, while Claude Code also has your terminal.

Claude Code 2.1.282 in a terminal, asked to review a WooCommerce store-hours plugin for WordPress coding standards and a UTC+5:30 timezone, stopping to ask permission before it runs a shell command to check for PHP and PHPCS.
Claude Code reviewing a small WooCommerce plugin. Notice that it stops to ask before running even a read-only shell command, because nothing has been pre-approved yet. Captured 27 October 2026, Claude Code 2.1.282.

That difference decides what you can ask for. The Claude app connected through a Claude connector for WordPress can rewrite a page. Claude Code can rewrite the page, change the plugin that renders it, run the plugin’s tests, commit the change to Git and check the error log, all in one session.

JobRoute Claude Code usesExample prompt
Write and edit contentMCP: create_content, patch_content, validate_blocks“Draft a Shipping and returns page from this policy text. Keep it as a draft.”
SEO and custom fieldsMCP: get_meta, set_meta“Fill in the Rank Math description on every product category page that has none.”
Plugins and themesMCP: plugin_operations, theme_operations, or WP-CLI over SSH“List plugins with updates. Update them one at a time and check the home page after each.”
Theme and plugin codeLocal files and Git, SSH and SFTP, or MCP plugin_files and theme_files“Add a size guide tab to single product pages in the child theme.”
DebuggingMCP site_logs, or instawp logs in the terminal“Why is /checkout/ returning a 500? Read the PHP error log first.”
Sites themselvesThe InstaCLI or InstaWP Account MCP“Create a temporary sandbox on PHP 8.3 and install WooCommerce on it.”

The middle column is the split that matters. MCP is how Claude Code works inside the running site; the shell is how it works on the code and the server. The same site usually needs both, so the next two sections set up each lane.

Two lanes into one WordPress site: MCP for the site, the shell for the code Claude Code in your terminal Local Git repotheme + plugin code CLAUDE.mdsite rules it reads first MCP: /insta-mcp + Authorization: Bearer token 43 typed tools: content, blocks, meta, plugins, media, logs Shell: SSH, SFTP, WP-CLI, Git deployment files, database, tests, logs, deploys WordPress site a staging copy first InstaMCP plugin (MCP server) wp-content files + database a person pushes to production
Neither lane replaces the other: MCP cannot run your test suite, and a shell does not give the agent typed, permission-checked content tools.

How do you connect Claude Code to WordPress with MCP?

The easiest way to connect Claude Code to WordPress is to host the site with a provider that has an MCP server built in. The server comes installed, secured and updated for you, so the whole setup is one switch in the hosting dashboard and one command in your terminal. On hosting without one, you install and configure an MCP plugin yourself, create an application password and often run a local proxy before Claude Code sees a single tool.

InstaWP, managed WordPress hosting with MCP built in, gives Claude Code two MCP servers. They do different jobs, and many teams connect both:

 InstaWP Account MCPInstaMCP (site MCP)
What it controlsYour InstaWP account: create and back up sites, change PHP and WordPress versions, read diagnostics.Everything inside one WordPress site: 43 tools for posts, blocks, meta, plugins, themes, media and logs.
Where you switch it onThe MCP tab in your InstaWP account.The site’s Extensions tab, then MCP.
How Claude Code signs inOAuth with your InstaWP login. You choose read-only or read-write when you sign in.A connection URL with a 64-character token.
Connections you needOne, for every site in your team.One per site.
Best forAgencies running many client sites.Content, settings and plugin work on a single site.

Read the table this way: the Account MCP works outside your sites, and InstaMCP works inside one. With five sites, a connection per site is manageable. With forty, one Account MCP connection is the practical choice, and it can switch on each site’s InstaMCP for you. The InstaWP Account MCP guide lists every capability and how to switch the sensitive ones off.

The InstaWP Account MCP settings with the Enable MCP for your account switch, the connection URL app.instawp.io/mcp and how to add it to Claude as a connector.
The Account MCP settings: one switch and one connection URL for every site in your team. Captured October 2026.

Add InstaWP from the Claude connector directory

InstaWP is listed in the Claude connector directory, the catalog of connectors inside Claude. Add it once at claude.ai/customize/connectors and sign in with your InstaWP account. Claude Code then loads it automatically whenever you are logged in to Claude Code with the same Claude subscription, as Anthropic’s Claude Code MCP documentation describes. Type /mcp in a session and InstaWP appears in the claude.ai part of the list. There is no command to run and no token in your terminal.

One limit applies. Claude Code fetches claude.ai connectors only when you sign in with a Claude subscription. If you run it with an ANTHROPIC_API_KEY, or through Amazon Bedrock or Google Cloud, add the server with the command in Step 3 below instead.

The InstaWP Academy video below shows the setup for both Claude Desktop and Claude Code.

InstaWP Academy: Connect Claude Desktop and Claude Code to WordPress in minutes.

To connect a single site with InstaMCP, turn on its MCP server, then register it in Claude Code with claude mcp add --transport http, the server URL and a bearer token. The five steps below use the exact commands from Claude Code 2.1.282.

Using the Claude desktop app or claude.ai instead? Those connect through a custom connector, not a terminal command. InstaWP covers that route and four others in how to connect Claude with WordPress.

Step 1: Install Claude Code

Install it with Anthropic’s native installer, which keeps itself updated, then check the version. Claude Code needs a paid Claude plan (Pro, Max, Team or Enterprise) or a Claude Console account; the free claude.ai plan does not include it, per Anthropic’s setup guide.

bashterminal
# macOS, Linux and WSL (Windows PowerShell: irm https://claude.ai/install.ps1 | iex)
$ curl -fsSL https://claude.ai/install.sh | bash
$ claude --version
2.1.282 (Claude Code)

Step 2: Turn on MCP for the WordPress site

In the InstaWP dashboard, open the site, then Extensions, then MCP, and switch on Enable MCP. That installs InstaMCP, the WordPress MCP server built into InstaWP sites, and shows the site’s connection URL with its 64-character token. The site MCP documentation covers every setting. InstaMCP runs on sites hosted on InstaWP; for a site hosted elsewhere, the official WordPress MCP Adapter plugin is the usual route, and InstaWP’s Claude and WordPress guide walks through it.

The MCP tab of an InstaWP site with Enable MCP switched on, the connection URL with its token blurred, the Add to Claude Code button next to Add to Claude.ai, Add to Cursor and Add to VS Code, and a Claude Code (CLI) entry labelled native HTTP in the setup guides list.
Step two. The Add to Claude Code button and the “Claude Code (CLI), native HTTP” setup guide sit on the same tab. Captured 14 October 2026 on WordPress 7.1.3.

Step 3: Add the site to Claude Code

Either click Add to Claude Code on the MCP tab, or copy the command from the Claude Code (CLI) setup guide and run it yourself. The button opens Claude Code (version 2.1.91 or later) with the add command already typed in; nothing runs until you review it and press Enter. The setup guide gives the same command with the token in the URL as ?t=.

The InstaWP setup guide for AI clients with the Claude Code (CLI) entry expanded, labelled native HTTP, showing a claude mcp add --transport http command with the site URL and a blurred token, below the Claude Desktop entry that uses mcp-remote.
The setup guide fills in your site URL and token, so the command can be pasted as it is. Captured 12 October 2026.

The cleaner form sends the token as a header and keeps it in an environment variable, so it does not sit in your shell history. This is the form InstaWP used:

bashterminal
# the token is the value after ?t= in the site's connection URL
$ export INSTAMCP_TOKEN="paste-your-token-here"
$ claude mcp add --transport http my-site \
    https://my-site.instawp.site/insta-mcp \
    --header "Authorization: Bearer $INSTAMCP_TOKEN"
Added HTTP MCP server my-site with URL: https://my-site.instawp.site/insta-mcp

Two details are worth knowing. The shell expands $INSTAMCP_TOKEN when you run the command, so the token ends up in ~/.claude.json, which is where Claude Code keeps servers added at its default local scope. And my-site is only a label: use one per site, such as client-store-staging, so the agent never confuses staging with production.

Step 4: Share the connection with your team without sharing the token

Add the server at project scope and Claude Code writes it to .mcp.json in the repository root, which you can commit. Write the token as ${INSTAMCP_TOKEN} in that file: Claude Code expands environment variables in url and headers at runtime, as its MCP documentation describes, so each developer supplies their own token and none lands in Git.

json.mcp.json
{
  "mcpServers": {
    "client-store-staging": {
      "type": "http",
      "url": "https://client-store-staging.instawp.site/insta-mcp",
      "headers": {
        "Authorization": "Bearer ${INSTAMCP_TOKEN}"
      }
    }
  }
}

Claude Code asks each developer to approve a server from .mcp.json before it uses it, and claude mcp list shows it as pending approval until they do. That is a useful check on a file anyone with commit access can change.

Step 5: Check that Claude Code sees the site

Run claude mcp list in the terminal, or type /mcp inside a Claude Code session, and look for Connected. InstaWP added the same sandbox twice on 12 October 2026, once as a native HTTP server and once through the mcp-remote bridge that Claude Desktop needs, and both connected. Claude Code speaks HTTP natively, so it does not need the bridge.

Terminal output from Claude Code 2.1.282 adding the same InstaMCP sandbox twice, once with claude mcp add --transport http and a bearer header, once as a stdio server through npx mcp-remote, followed by claude mcp list showing both servers as Connected.
Native HTTP and the mcp-remote bridge both reached the site, so use the shorter native form. Captured 12 October 2026, Claude Code 2.1.282.

If the server does not show as connected, ask the endpoint directly. InstaWP broke the connection five ways in its tests, and each cause gives a different server response even when the client shows one generic error:

CauseWhat the server returnsFix
MCP switched off on the siteHTTP 200 with an HTML page (the site’s home page)Switch on Enable MCP on the site’s MCP tab.
Wrong tokenHTTP 401, "message":"Invalid token"Copy the token again from the MCP tab.
No token sentHTTP 401, "message":"Authentication required"Add the --header, or check the variable is exported.
Wrong pathHTTP 404 with an HTML pageThe path is /insta-mcp unless someone changed the endpoint slug.
Environment variable not setHTTP 401Export the variable in the shell that starts Claude Code.

Read the middle column as the diagnosis: an HTML answer means the request never reached InstaMCP, and a JSON 401 means it did and only the token is wrong. This command sends the same first request Claude Code sends:

bashterminal
# expect: 200 application/json
$ curl -s -o /dev/null -w "%{http_code} %{content_type}\n" -X POST \
  -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer $INSTAMCP_TOKEN" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1"}}}' \
  https://my-site.instawp.site/insta-mcp
Managing many sites? Add your whole InstaWP account once instead of one server per site: claude mcp add --transport http instawp https://app.instawp.io/mcp, then run /mcp in a session to sign in with OAuth and choose read-only or read and write. InstaWP Account MCP works at the hosting level (sites, backups, plugins across sites); Account MCP vs Site MCP explains when each fits.

How do you edit WordPress theme and plugin code with Claude Code?

Give Claude Code the code in a form it can test: a local Git repository that deploys to the site, an SSH session on the site, or, for a one-file fix, InstaMCP’s file tools. Claude Code is at its best with real files and a shell, because it can run php -l, WP-CLI and your tests after every change instead of guessing. Each option below works on an InstaWP site, and most agencies end up using the first one with the second for checks.

OptionHow it worksBest forWatch out for
A. Local repo + Git deploymentClaude Code edits and commits locally; the site pulls the branch through Git deployment.Custom themes and plugins you own and reviewDeploys only what is in the repo, not database changes
B. SSH, SFTP and WP-CLI on the siteClaude Code runs commands on the server with instawp wp, instawp ssh and instawp sync.Debugging, WP-CLI jobs, quick fixes on stagingEvery command is a live change, so approve each one
C. InstaMCP file toolsplugin_files and theme_files read and write single files over MCP.A small fix when no repo existsSafe Mode blocks writes; PHP changes can lag about 40 seconds

Start with the last column. It is what decides between the options on a real project, more than any feature list.

Option A: Work in a local Git repository and deploy it

Keep the theme or plugin in Git, run Claude Code in that folder, and let the site pull the branch. On InstaWP that is Developer Tools, Git Deployment: connect the repository, set the branch and the destination folder, and use the deploy URL as a webhook or the Deploy button. Claude Code never needs write access to the server, and every change it makes is a commit a person can review. InstaWP covers the setup in how to deploy WordPress from GitHub.

The Git Deployment page under Developer Tools on an InstaWP Pro site, showing a connected repository git@github.com:your-org/my-plugin.git on branch main with destination wp-content/plugins/my-plugin, a deploy webhook URL, a Deploy button and a Save button.
One repository per plugin, deployed into its own folder under wp-content/plugins. Captured 14 October 2026 on WordPress 7.1.3.
InstaWP Academy: How to Run Git Deployments on InstaWP.

Put the rules for the site in a CLAUDE.md file at the repository root. Claude Code reads it at the start of every session, as its memory documentation explains, so you only write “never touch production” once. A short one for a client plugin:

markdownCLAUDE.md
# Client store plugin

- Work only on the staging site (MCP server: client-store-staging).
  Never call the production server or push to production.
- Run php -l on every PHP file you change, then
  instawp logs client-store-staging --php -n 50 after each deploy.
- Prefix functions with cs_ and escape all output (esc_html, esc_attr).
- Ask before running anything that deletes data.

For reusable playbooks that go beyond one project, Claude Code also supports skills. InstaWP tested fifteen skill collections for agency work in Claude Code skills for web development.

Option B: Let Claude Code run WP-CLI and SSH on the site

Switch on SSH for the site, install InstaCLI, and Claude Code can run WP-CLI and shell commands on the server from your terminal. In the InstaWP dashboard it is Developer Tools, SFTP/SSH, and one Enable SSH/SFTP toggle turns on both, as the SFTP and SSH documentation explains. The same menu has a browser-based Web Terminal for checking by hand.

The InstaWP SFTP/SSH panel with Enable SSH/SFTP switched on and Connection Details showing the host name, user name, a masked password and port 22.
One toggle enables both SSH and SFTP; the same host, user and port work for an SFTP client, rsync and InstaCLI. Captured October 2026.

InstaCLI authenticates from an INSTAWP_TOKEN environment variable and every command takes --json, which is why it suits an agent: no browser login, and output Claude Code can parse. These are the commands it uses most, checked against InstaCLI 0.0.1-beta.33:

bashterminal
$ npm install -g @instawp/cli@beta
$ export INSTAWP_TOKEN="your-instawp-api-token"

# WP-CLI on the remote site (use -- to pass raw WP-CLI arguments)
$ instawp wp client-store-staging plugin list --update=available
$ instawp wp client-store-staging -- post list --post_type=page --format=json

# copy wp-content down, edit locally, preview the upload, then push it back
$ instawp sync pull client-store-staging
$ instawp sync push client-store-staging --dry-run

# read the PHP error log after a change
$ instawp logs client-store-staging --php -n 100

Control what Claude Code may run without asking in .claude/settings.json. Allow the read-only and staging commands, and deny the ones that should always need a person, using the permission rules in Claude Code’s settings reference:

json.claude/settings.json
{
  "permissions": {
    "allow": [
      "Bash(instawp wp client-store-staging:*)",
      "Bash(instawp logs:*)",
      "Bash(php -l:*)"
    ],
    "deny": [
      "Bash(instawp sites delete:*)",
      "Bash(instawp db push:*)",
      "Bash(instawp versions restore:*)"
    ]
  }
}

The InstaCLI command reference lists every command, and InstaCLI for CI/CD and AI agents shows the loop an agent runs: create a temporary site, install plugins, read logs, delete it. The InstaWP Academy video on WP-CLI and SSH commands in your browser covers the dashboard side.

Option C: Edit a single file over MCP

For a small fix on a site with no repository, Claude Code can read and write plugin and theme files through InstaMCP’s plugin_files and theme_files tools. InstaMCP syntax-checks PHP before it saves, so a broken edit is rejected, and each write saves a backup under wp-content/insta-mcp-backups/. Two things surprised InstaWP in testing: Safe Mode refuses the write (“Write plugin file is not allowed”) until a site admin unticks it, and the live page kept serving the old code for about 40 seconds because of PHP’s OPcache. Tell Claude Code to wait and re-check before it “fixes” a change that already worked.

Should Claude Code work on a local site or a hosted sandbox?

Use a local site for fast code loops and a hosted sandbox for anything that has to behave like production. A local install (Docker, LocalWP or similar) is quick and free, but a cloud MCP client cannot reach it and it does not run your host’s PHP, caching or server rules. A hosted InstaWP sandbox has a public URL, its own MCP endpoint, SSH and the same stack the production site runs on.

Local installHosted InstaWP sandbox
Claude Code can edit filesYes, directly on diskYes, over Git deployment, SSH, Local Mount or MCP
MCP from cloud clients (claude.ai, ChatGPT)No, they cannot reach localhostYes, over HTTPS
Same PHP, cache and server as productionOnly if you rebuild itYes, the sandbox can be moved to a paid plan or copied as staging
Share a link with a clientNeeds a tunnelYes, a public URL
CostFreeFree to start; Sandbox plans for MCP

The third row is the one that bites. A plugin that works on a laptop and fails on the host is the most common reason an AI-built change breaks in production, and a hosted sandbox removes that gap. InstaWP’s Local Mount feature gives a hosted site a local folder, which is a middle ground for editors that expect files on disk.

How do you create a WordPress plugin with Claude Code?

Describe the plugin’s behaviour, constraints and checks in one prompt, let Claude Code write the files and lint them, then install the plugin on a test site and check the result yourself. InstaWP did exactly that on 26 October 2026 with a small, real plugin: a “Last updated on” line above blog posts that were edited at least a day after publishing. The whole build took one prompt.

textprompt given to Claude Code
Create a WordPress plugin in the folder ./last-updated-notice.

What it does: on single blog posts, show a short "Last updated on <date>" line above
the post content, but only when the post was modified at least 24 hours after it
was first published.

Requirements:
- Use the site's own date format setting.
- Escape all output. No settings page, no JavaScript, no external requests.
- Add a filter named last_updated_notice_label so a theme can change the text.
- Prefix every function, follow WordPress coding standards, and include a readme.txt.
- Keep it to one main PHP file plus the readme.

When the files are written, run php -l on every PHP file and fix any error it reports.
Finish with a one-paragraph summary of what you built.
MeasureResult (26 October 2026)
Claude Code version and model2.1.282, Claude Opus 5.5, run headless with claude -p
Tool calls4: create the folder, write the PHP file, write the readme, run php -l
Time and cost22.8 seconds, $0.18 (as reported by Claude Code)
Fileslast-updated-notice.php (59 lines) and readme.txt
php -lNo syntax errors
Live test on WordPress 7.1, PHP 8.2Post edited six days after publishing: notice shown. Post published the same day: no notice. Home page: no notice.

Only the last row proves anything. A clean lint and a confident summary say the code parses; the live test says it does what the prompt asked. This is the core of the file Claude Code wrote:

phplast-updated-notice/last-updated-notice.php (excerpt)
// written by Claude Code 2.1.282; plugin header and docblocks omitted here
function last_updated_notice_filter_content( $content ) {
	if ( ! is_singular( 'post' ) || ! in_the_loop() || ! is_main_query() ) {
		return $content;
	}

	$post = get_post();
	if ( ! $post || get_queried_object_id() !== $post->ID ) {
		return $content;
	}

	$published = (int) get_post_time( 'U', true, $post );
	$modified  = (int) get_post_modified_time( 'U', true, $post );

	if ( ! $published || ! $modified || ( $modified - $published ) < DAY_IN_SECONDS ) {
		return $content;
	}

	$label = apply_filters( 'last_updated_notice_label', __( 'Last updated on', 'last-updated-notice' ), $post );

	$notice = sprintf(
		'<p class="last-updated-notice">%1$s <time datetime="%2$s">%3$s</time></p>',
		esc_html( $label ),
		esc_attr( get_the_modified_date( DATE_W3C, $post ) ),
		esc_html( get_the_modified_date( get_option( 'date_format' ), $post ) )
	);

	return $notice . $content;
}
add_filter( 'the_content', 'last_updated_notice_filter_content' );

The code is sound: it compares GMT timestamps so time zones cannot skew the 24-hour check, escapes every value it prints, and checks the main query so the notice does not leak into widgets or excerpts. Two things still needed a person:

  1. The readme said “Tested up to: 6.8”. WordPress was on 7.1 at the time, and the readme header is what WordPress.org and site owners read. Models default to the versions they saw in training, so check every version number an agent writes.
  2. It never ran the coding standards check. Its own summary said so: “I haven’t run it in a real WordPress site or checked it with the WordPress coding-standards linter (PHPCS).” Run WordPress Coding Standards before you ship, or add it to the prompt.

To put the plugin on a site, InstaCLI uploads a local folder or zip in one command, or Claude Code can install a zip through InstaMCP’s plugin_operations tool. Install it on staging first:

bashterminal
$ instawp plugin install client-store-staging ./last-updated-notice --activate
$ instawp logs client-store-staging --php -n 50

For a longer walkthrough that covers planning a plugin with AI, packaging it and testing it on a sandbox, see how to build a WordPress plugin using AI. The WordPress Plugin Handbook is the reference for reviewing what the agent wrote: nonces, capability checks, sanitised input and escaped output.

Test what Claude Code builds on a real WordPress hostSpin up an InstaWP sandbox, install the plugin with one InstaCLI command, and throw the site away when you are done.
Create a sandbox →

How do you deploy WooCommerce changes with Claude Code?

Have Claude Code make and test the change on a staging copy of the store, back up production, then ship code and data differently: push code (a plugin, a theme, a template), and replay content, product and settings changes on the live store. Do not push a whole staging database over a live store that is taking orders. On InstaWP, a push replaces the production files and database, so any order placed on live since the staging copy was made would disappear.

That one rule shapes the whole workflow, because WooCommerce is the one kind of WordPress site where the live database keeps changing while you work: orders, customers, stock and coupons all move on their own. The diagram shows the safe route.

Ship code with a deploy. Replay data on live. Orders never stop arriving. 1. Pull to stagingfresh copy ofthe live store 2. Change itClaude Code onstaging only 3. Shop itadd to cart, readthe charged price 4. Back up livebackup orinstawp versions 5a. Code: deploy itplugin, theme, template filesGit deployment or instawp sync push 5b. Data: replay it on liveproducts, prices, pages, settingssame prompt, live MCP server Full push over livereplaces the live databaseonly if the store is frozen 6. Check live + PHP error log
The red path is the one people take by habit, and on a store that is taking orders it is the one that loses data.

Step 1: Refresh the staging copy and point Claude Code at it

Pull the live store to staging so Claude Code works on current products and settings, then give it the staging site’s own MCP server, not the live one. On InstaWP that is Developer Tools, Staging Site on the production site, then Pull to staging; the staging site keeps its own URL, MCP tab and SSH details. Staging is available on InstaWP managed hosting plans from Pro, and the pull and push documentation explains both directions.

The InstaWP staging card showing a production site and its staging copy side by side, with Pull to staging and Push to production buttons between them.
Pull refreshes staging from live; push replaces live with staging. Neither one merges. Captured 12 October 2026.

Step 2: Make the change and check it the way a shopper would

Ask Claude Code for the change, then ask it to prove the result from the storefront, not from wp-admin and not from its own tool replies. InstaWP’s hands-on test of five WooCommerce MCP servers on 9 October 2026 shows why. A generic post-meta write changed a product’s regular price from $35 to $30, the tool replied that the meta was updated, and wp-admin showed $30. A real add-to-cart through the WooCommerce Store API still charged $35, because WooCommerce’s own price field and lookup table were never updated.

Side by side: the WooCommerce product editor showing a regular price of 30 dollars after a generic post meta write, while the storefront for the same Milk Frother product still shows 35 dollars.
The editor and the storefront disagree after a generic meta write. The fix is to write prices through WooCommerce, which InstaMCP’s set_meta does by default for products. Captured 9 October 2026 on WooCommerce 11.2.0.

Two more WooCommerce traps from the same test belong in your prompt. With High-Performance Order Storage (HPOS) on, which has been the default for new stores since WooCommerce 8.2, generic post tools found 0 of the store’s 8 orders, while WooCommerce’s own order tools found all 8. And changing an order’s status runs WooCommerce’s normal status transition, so its customer emails fire as they would on live; check where a staging copy sends mail before you test order changes. WooCommerce’s HPOS documentation explains the storage change, and the Store API documentation covers the cart endpoints.

textprompt for a WooCommerce change on staging
Use the client-store-staging MCP server only.
Put every product in the Summer category on a 20% sale until 31 October.
Write prices through WooCommerce (product objects), not raw post meta.
Then add one sale product to a cart through the Store API and tell me the price it charges,
and list any product where the cart price differs from the sale price.

Step 3: Back up production before anything ships

Take a backup of the live store or create a version first, because a push has no automatic undo and InstaWP does not back up production for you before it. On InstaWP, use the site’s Backups page or Versions; InstaCLI does the same from the terminal, and Claude Code can run it as the first step of the deploy.

The InstaWP Backups and Restore screen on a Pro site, listing automated and on-demand backups with restore and download actions.
Automated and on-demand backups on a Pro site, each with a restore action. Captured 9 October 2026.
bashterminal
$ instawp versions create client-store --name "before summer sale"
$ instawp versions list client-store
# rollback if needed: OVERWRITES current files and database
$ instawp versions restore client-store <version-id>

Step 4: Ship code by deploy, and replay data on the live store

Ship code the same way you would without an agent: through Git deployment or a targeted file sync of the one plugin or theme folder. Ship content and data by running the same prompt against the live store’s MCP server, so new orders, customers and stock levels are left alone. The guide to syncing staging to live without overwriting WooCommerce orders covers the merge-based alternative for sites hosted elsewhere.

bashterminal
# preview, then deploy only the plugin folder to production
$ instawp sync push client-store --path ./wp-content/plugins/cs-size-guide/ \
    --remote-path wp-content/plugins/cs-size-guide/ --dry-run
$ instawp sync push client-store --path ./wp-content/plugins/cs-size-guide/ \
    --remote-path wp-content/plugins/cs-size-guide/
$ instawp logs client-store --php -n 50

A full Push to production is the right tool when the store is frozen, for example a rebuild launched in a maintenance window. The confirmation dialog states the trade-off plainly:

The InstaWP confirmation dialog titled Replace production with staging, warning that everything on the production site, files, database, plugins, themes and content, will be replaced by the staging copy, that there is no automatic undo and no backup is taken first, with Cancel and Push to production buttons.
The push dialog on a WooCommerce store. Domain, SSL and plan stay; everything else is replaced. Captured 12 October 2026, cancelled without pushing.
A push also copies the staging site’s MCP token to production. InstaWP’s MCP documentation notes this. If you replaced or revoked a token on production, check the InstaMCP API Tokens tab again after every push, or the agent that only had staging access now has production access too.

Step 5: Check the live store

Repeat the shopper check from step 2 on the live store, read the PHP error log, and only then close the task. InstaCLI’s instawp logs client-store --php and InstaMCP’s site_logs read the same logs, so Claude Code can do both checks in one prompt.

How do you keep Claude Code safe on a live WordPress site?

Give it the least access the job needs, on a copy of the site, and verify its work against the site rather than its summary. In practice that means a token for a lower-privileged WordPress user with an expiry, Safe Mode on, the three power tools off, and Claude Code’s own approvals for anything that writes. InstaWP tested each of these with Claude Code on 12 October 2026 on the staging copy of a WooCommerce store.

Use a scoped, expiring token

An InstaMCP token inherits the role of the WordPress user it belongs to, so a token for an Editor user cannot install or update plugins whatever the agent tries. Create one under Settings, InstaMCP, API Tokens in wp-admin, pick the user, add a label and an expiry in days, and copy the token, which is shown once.

The InstaMCP API Tokens tab in WordPress admin, with the Create New Token form and an All Tokens list showing a Content agent (staging) token for the content-agent user, created 12 October 2026 and expiring 19 October 2026, above the administrator's Default Token, which never expires.
An Editor token for a dedicated content-agent user, expiring in 7 days. Captured 12 October 2026 on the staging copy of a WooCommerce store.

With that token, in a run of 9 MCP calls that took 47.5 seconds and cost $0.20, Claude Code 2.1.282 created a draft page attributed to the content-agent user. Every one of the five plugin updates it attempted was refused with “requires the ‘mcp:admin’ scope. You have: mcp:delete, mcp:write, mcp:read”. Its suggested fix was to grant mcp:admin, which is exactly the request a person should say no to.

The WordPress Pages screen on a staging store, with a draft page called Shipping and returns authored by content-agent, last modified 12 October 2026, among the store's existing pages.
The draft Claude Code created with the Editor token, attributed to the content-agent user rather than the site admin, so its work is easy to find and review. Captured 12 October 2026.

Verify the site, not the summary

With an admin token on the same staging copy, Claude Code was asked to update the five plugins that showed an update. It finished in 13 MCP calls, 55.9 seconds and $0.27, and returned a five-row table with five green ticks. Only one plugin version had changed. The other four had stale update flags, and InstaMCP had replied “already up to date” each time; the summary turned that into success. An independent check of the plugin versions, the HTTP status of the home, shop and cart pages, and the debug log caught it.

Put the check in the prompt. End every write request with how to prove it: “then list each plugin’s version before and after”, “then fetch the page and quote the line you changed”, “then read site_logs for fatal errors”. Claude Code does it in the same run, and a mismatch shows up before you close the task.

Keep Safe Mode on and the power tools off

Safe Mode, on InstaMCP’s General tab, blocks every delete and the write side of the power tools; in InstaWP’s tests it also blocked plugin file writes. The Capabilities tab keeps execute_php, db_query and site_files off until an admin turns them on. Claude Code still sees all 43 tools, so it can tell you a tool exists and how to enable it, but the call is refused.

The General tab of InstaMCP settings in WordPress admin, with the endpoint slug insta-mcp and the Safe Mode checkbox ticked.
Safe Mode on. Untick it for the one write that needs it, then tick it again. Captured 21 October 2026, InstaMCP 1.11.4.
The Capabilities tab of InstaMCP settings, with the Execute PHP checkbox unticked and the Database Query and Site Files tools both set to Off, each with a warning about what it allows.
The three power tools ship switched off; each needs an administrator token as well as this switch. Captured 21 October 2026.
RiskClaude Code controlInstaWP control
The agent changes something you did not ask forLeave approvals on; allow only named commands in .claude/settings.json.Editor or Author token; Safe Mode blocks deletes.
A broken code changeReview the diff before approving; require php -l and tests in CLAUDE.md.PHP syntax check and a backup on every MCP file write; site backups and versions.
A leaked token${INSTAMCP_TOKEN} in .mcp.json, never the literal token.Revoke it under API Tokens. Switching MCP off and on keeps the same token.
Raw PHP or SQLDeny the tools in the session if you do not need them.Power tools off by default and admin-only.
Unreviewed changes reaching customersPoint the agent at the staging server name only.Staging site with its own MCP endpoint; a person clicks Push.

The right-hand column is the backstop. Any Claude Code setting can be relaxed from inside a session by a user in a hurry; the WordPress-side controls hold whatever the agent decides, because only a site admin can change them. InstaWP goes deeper on the risks in is WordPress MCP safe and how to use MCP for WordPress in production, and shows a security hardening run in harden WordPress using AI.

Use Claude Code on WordPress for
Building and fixing your own themes and plugins, with tests and a Git history
Bulk content, SEO and product changes on a staging copy
WP-CLI chores and debugging from the error log
Rehearsing a WooCommerce change before replaying it on live
Do not use it for
Editing a live store with an admin token, Safe Mode off and every command pre-approved
Pushing a staging database over a store that is taking orders
Trusting a success table without checking the site
Turning on execute_php to skip a step the typed tools already cover

Should you use Claude Code, the Claude app, Codex or Cursor for WordPress?

Use Claude Code or Codex when the work is code plus terminal commands, Cursor when you want to read every file and diff in an editor, and the Claude app when the work is content and settings with no code at all. All four connect to the same InstaMCP URL, so the WordPress side does not change when you switch.

Claude CodeClaude app (desktop, claude.ai)Codex CLICursor
Where it runsTerminal (also IDE and desktop)Chat windowTerminalCode editor
How it adds a WordPress siteclaude mcp add --transport httpCustom connector with the MCP URLcodex mcp addmcp.json or Add to Cursor
Shell, Git, WP-CLIYesNoYesYes
Project rules fileCLAUDE.mdProject instructionsAGENTS.mdRules files
Best WordPress fitPlugins, themes, deploys, WooCommerce rehearsalsContent and settings, no codePlugins, themes, scripted jobsReading and reviewing code changes
InstaWP guideThis pageConnect Claude with WordPressConnect Codex to WordPressConnect Cursor to WordPress

The “Shell, Git, WP-CLI” row is the dividing line. The Claude app can do a lot through MCP alone, but it cannot run your tests or deploy code. For a broader look at the tools, InstaWP’s roundup of AI coding tools for WordPress developers compares more of them, and the Model Context Protocol site has the specification all four use.

The short version

Switch on MCP on the WordPress site and run claude mcp add --transport http with its URL and a bearer token, kept in an environment variable. Give Claude Code the code through Git or SSH so it can test what it writes, and put the site’s rules in CLAUDE.md. Work on a staging copy with an Editor token and Safe Mode on. For WooCommerce, ship code by deploy and replay data changes on live, because a push replaces the live database. Then check the site yourself: in InstaWP’s test, five green ticks meant one real update.

Run Claude Code on a WordPress site built for agentsEvery InstaWP site has InstaMCP, SSH, WP-CLI, Git deployment and staging. Start on a sandbox and move it to a production plan when it is ready.
See hosting plans →

Claude Code and WordPress: FAQs

How do I connect Claude Code to WordPress?

Switch on an MCP server on the WordPress site, then run claude mcp add –transport http with a name, the server URL and an Authorization: Bearer header. On an InstaWP site, the MCP tab has an Add to Claude Code button and a copyable command. Check it with claude mcp list, which should show Connected.

Does Claude Code work with WordPress MCP?

Yes. Claude Code speaks MCP over HTTP natively, so it connects to a WordPress MCP server without a bridge. On an InstaWP site it gets InstaMCP’s 43 tools for content, blocks, meta, plugins, themes, media and logs. InstaWP tested this with Claude Code 2.1.282 in October 2026.

Can I create a WordPress plugin with Claude Code?

Yes. In InstaWP’s test on 26 October 2026, Claude Code wrote a working “Last updated” plugin from one prompt in 22.8 seconds for $0.18, and it passed a live test on WordPress 7.1. Review the result: its readme listed an old WordPress version and it had not run the coding standards check.

How do I deploy WooCommerce with Claude Code?

Make and test the change on a staging copy of the store, back up production, then deploy code changes with Git or a file sync and replay product, content and settings changes on the live store. Avoid pushing a staging database over a store that is taking orders, because a push replaces the live database and orders placed since the copy would be lost.

Can I connect WooCommerce to Claude Code?

Yes. A WooCommerce store is a WordPress site, so the same MCP connection works. Ask Claude Code to write prices through WooCommerce rather than raw post meta, and to check changes with a real add-to-cart, because a generic meta write can leave the storefront charging the old price.

Do I need the Claude app or Claude Code for WordPress?

Use Claude Code if the work involves code, a terminal, WP-CLI or deployments. Use the Claude desktop app or claude.ai if the work is only content and settings. Both connect to the same WordPress MCP URL.

Is it safe to give Claude Code access to a live WordPress site?

It is safe enough with limits on both sides: a token for an Editor user with an expiry, InstaMCP Safe Mode on, the PHP and database power tools off, Claude Code approvals on, and a staging copy for anything risky. Then check the site after each task rather than trusting the agent’s summary.

Does Claude Code need SSH access to WordPress?

No. MCP alone lets it edit content, settings, plugins and theme files. SSH, WP-CLI or a Git deployment is worth adding for code work, because it lets Claude Code run linters, tests and WP-CLI against the site.

NS
Neha Sharma
Content, InstaWP

Neha writes practical WordPress tutorials and agency playbooks, with a focus on dev workflows and AI building.