---
title: "Claude Code for WordPress: A Working Setup"
description: "Set up Claude Code for WordPress: a local site, CLAUDE.md, MCP via claude mcp add, native Elementor 4 builds, and guardrails that keep it off production."
source: https://wpos.ai/blog/claude-code-wordpress/
updated: 2026-11-17
---

[Black Friday](https://wpos.ai/black-friday/): 15,000 free credits + 50% off ends Nov 30

# Claude Code for WordPress: A Working Setup for Building Real Sites

Claude Code is at its best on WordPress when it can see the code and reach the site: theme and plugin files on disk, WP-CLI in the terminal, and an MCP server for content and layout. This is a setup that works, including native Elementor 4 builds with Elementor Ultra, and the guardrails that keep it off production until you are ready.

- Claude Code

- WordPress

- Developers

## What Claude Code is good at on WordPress

**Claude Code is a coding agent that works in your terminal, on the files and commands you give it.** On WordPress that makes it strong at:

- **Theme and plugin code:** child themes, custom blocks, small plugins, PHP fixes and refactors, with the whole codebase in view.
- **WP-CLI work:** search-replace, imports, user and option changes, and scripted maintenance, run as commands you can read before they execute.
- **Debugging:** reading `debug.log`, tracing a hook or a slow query, and proposing a fix.
- **Content and layout, through MCP:** once a site is connected over MCP, it can create and edit posts, pages and settings, and with the right tools, page-builder layouts.

## Step 1: Work on a local or staging copy

**Point Claude Code at a copy, not at production.** Any local environment works: WordPress Studio, wp-env, LocalWP or your own Docker setup. For Elementor work, `npx @algorismus/elementor-ultra-playground` starts a local WordPress with Elementor and the Elementor Ultra companion plugin from a ready-made snapshot.

Keep secrets out of the repository. Put application passwords and API keys in environment variables or a local file that git ignores.

## Step 2: Give Claude Code your conventions

**Claude Code reads a `CLAUDE.md` file at the root of the project.** Use it for the things you would otherwise repeat in every session:

`# Project: client-site
- Theme: wp-content/themes/client-child (child of Twenty Twenty-Five)
- Coding standards: WordPress PHP coding standards; run composer lint before committing
- Local site: http://client-site.test (WP-CLI available)
- Never run search-replace or database commands against production
- Ask before installing or activating plugins`The same idea scales up: WPOS calls these [skills](https://wpos.ai/features/skills/) and stores them on your account, so the agent follows them on every client site.

## Step 3: Connect the site over MCP

**Add an MCP server so Claude Code can act on the site itself, not only its files.** Use whichever server suits the site:

`# WordPress.com, or a self-hosted site connected through Jetpack
claude mcp add --transport http wordpress-com https://public-api.wordpress.com/wpcom/v2/mcp/v1

# A plugin that gives you an HTTP endpoint (use the URL from its settings)
claude mcp add --transport http client-site https://client-site.test/your-plugin-mcp-endpoint

# The official MCP Adapter through Automattic's proxy
claude mcp add --transport stdio \
--env WP_API_URL=https://client-site.test/wp-json/mcp/mcp-adapter-default-server \
--env WP_API_USERNAME=agent-user \
--env WP_API_PASSWORD=your-application-password \
wordpress -- npx -y @automattic/mcp-wordpress-remote@latest`By default a server is added to the current project, privately for you. Use `--scope project` to share the configuration with your team in `.mcp.json`, or `--scope user` to make it available in every project. `claude mcp list` shows what is connected, and `/mcp` inside a session handles sign-in for servers that use OAuth.

If the sites are in a WPOS workspace, WPOS's own MCP server gives Claude Code the same tools as WPOS's built-in agent, including native Gutenberg, Elementor and Divi builds, WooCommerce and SEO, and your own agent doesn't spend WPOS credits. [Book a free 30-minute call with the founders](https://cal.com/algorismus/30min) to connect it.

Step-by-step details for each route are in [How to connect Claude to WordPress](https://wpos.ai/blog/connect-claude-to-wordpress/).

## Step 4: Build Elementor pages natively with Elementor Ultra

**If the site is built in Elementor 4, give Claude Code Elementor-aware tools.** Elementor Ultra, an open-source project from the WPOS team, adds an MCP server with about 90 tools for pages, widgets, global classes, variables, media, forms and rollback, and the `exjsx` compiler, which turns one typed JSX file into a verified, native Elementor page that stays editable in the Elementor editor.

Install it as a Claude Code plugin:

`/plugin marketplace add Algorismus-io/claude-plugin-elementor
/plugin install elementor@algorismus`Or work with the compiler directly:

`npx exjsx init site
npx exjsx build site`Deploying to a site uses an application password, supplied as `WP_URL`, `WP_USER` and `WP_APP_PASSWORD`. The toolkit's `--gates` dev loop re-checks every save at 1200, 1920 and 390 pixels wide, so layout breakage shows up before a client sees it. It is tested on Elementor 4.1.4 and 4.2.0; Elementor Pro is only needed for Pro features such as forms with submissions, popups and the theme builder. The [Elementor Ultra quickstart](https://docs.wpos.ai/ultra/quickstart?utm_source=wpos-ai&utm_medium=referral&utm_campaign=claude-code-wordpress&utm_content=ultra-quickstart) has the full setup, and [this walkthrough](https://wpos.ai/blog/build-elementor-pages-with-ai-agents/) shows the JSX-to-page workflow.

## Step 5: Guardrails that keep it off production

- **Keep the permission prompts.** Claude Code asks before it edits files or runs commands. Leave that on for anything that can reach a live site.
- **Commit before and after.** Work in a git branch so every change the agent makes can be reviewed and reverted.
- **Use a dedicated WordPress user** for MCP and deploys, with an application password you can revoke.
- **Separate staging and production configs.** Keep production MCP servers out of the shared project scope, so nobody runs against a live site by accident.
- **Back up before deploys**, and know how you would roll a page back.

## Claude Code and WPOS on the same sites

**Claude Code is a developer's tool for one project at a time.** It is excellent when the person driving it can read the diff. Agencies also have account managers, designers and clients who should not need a terminal, and dozens of sites to keep consistent.

WPOS covers both sides. Its built-in agent works inside wp-admin on every client site, building natively in Gutenberg, Elementor or Divi, following your team's skills and checking its own render before it reports done. And because WPOS speaks MCP, developers can drive those same sites from Claude Code with the same tools, without spending WPOS credits. [Try WPOS free for 30 days](https://app.wpos.ai/signup?ref_page=claude-code-wordpress&ref_cta=body-cta).

## Frequently Asked Questions

**Can Claude Code edit a live WordPress site?**

Yes, through an MCP server or WP-CLI, but it should not be your first step. Work on a local or staging copy, keep permission prompts on, and deploy changes you have reviewed.

**Does Claude Code work with Elementor?**

Yes. With Elementor Ultra, installed as a Claude Code plugin, it gets about 90 Elementor 4 tools and a JSX compiler that produces native, editable Elementor pages.

**What is the best local environment for Claude Code and WordPress?**

Any that gives Claude Code the files and WP-CLI: WordPress Studio, wp-env, LocalWP or Docker. For Elementor work, the Elementor Ultra playground starts a ready-made local site with one command.

**Where do I put project conventions for Claude Code?**

In a CLAUDE.md file at the root of the project. Claude Code reads it at the start of a session, so standards and rules do not need repeating.

**Should my whole team use Claude Code?**

Usually not. It suits developers who review diffs. With WPOS, developers can drive client sites from Claude Code over MCP while account managers and designers use the built-in agent in wp-admin on the same sites.

**Black Friday**ends Nov 30

## Start free with 15,000 credits.

Three times the usual 5,000, no card needed. Then 50% off your site licences for 2 months with FRIDAY50.

## Developers in Claude Code. Everyone else in WPOS.

Same client sites, same tools: WPOS's agent in wp-admin, or your own Claude Code over MCP. Free for 30 days, no card.

[Claim 15,000 credits](https://app.wpos.ai/signup?ref_page=claude-code-wordpress&ref_cta=prefooter-cta): Start free
