# WordPress MCP for Claude Code – Complete Installation Guide
I’ve spent the last few weeks figuring out how to connect Claude Code to WordPress, and honestly, it was a bit of a journey. But now that I’ve got it working smoothly, I want to share the exact steps that actually work – no fluff, just what you need to know.
## Why This Integration Changes Everything
Let me tell you why this setup is worth your time:
**Direct Content Management**
– Write and edit posts straight from Claude Code
– No more switching between browser tabs
– Perfect for us developers who live in the terminal
**Workflow Automation**
– Batch update multiple posts at once
– Generate content programmatically
– Integrate seamlessly with your existing dev tools
**Developer-First Approach**
– Version control your content like code
– Use your favorite text editor for everything
– Build this into your deployment pipelines
Once you have this running, you’ll wonder how you ever managed WordPress any other way.
## What You Need Before Starting
Let’s be upfront about the requirements:
– WordPress site (self-hosted or WordPress.com Business plan)
– Claude Code installed and running
– About 10 minutes for the complete setup
– Basic command line comfort (nothing too advanced)
## Installing the WordPress MCP Plugin
This is your foundation – everything else builds on this.
### Standard WordPress Installation
Jump into your WordPress admin dashboard:
1. Navigate to **Plugins > Add New**
2. Search for **”MCP Server for WordPress”**
3. Hit **Install Now** then **Activate**
4. You should see a confirmation that the plugin is active
That’s it for the WordPress side. The plugin creates all the API endpoints Claude Code needs to communicate with your site.
### Docker WordPress Setup
Running WordPress in Docker? No problem at all. I test this setup with Docker containers regularly.
The plugin installation process is identical:
– Make sure your WordPress container is running
– Access the admin dashboard normally
– Install and activate the plugin the same way
The key is ensuring your WordPress container is accessible from where you’re running Claude Code.
## Creating Your Application Password
This is where most people hit a wall, but it’s actually straightforward.
### Understanding Application Passwords
WordPress uses these special passwords for API access because they’re:
– More secure than your main login password
– Easy to revoke if something goes wrong
– Scoped specifically to API operations
### The Setup Process
Here’s the exact sequence:
1. In WordPress admin, go to **Users > Your Profile**
2. Scroll down to find **Application Passwords**
3. Enter a descriptive name: “Claude Code Integration”
4. Click **Add New Application Password**
5. **Copy the generated password immediately** – WordPress won’t show it again
Your new password looks something like this:
“`
Q9XS 3YAA RaPP 7wvd cjLH mS4l
“`
**Important:** Store this password securely. It gives full API access to your WordPress content.
## Configuring Claude Code
Now for the Claude Code configuration. This is where everything connects.
### Application Password Method (Recommended)
Add this configuration to your Claude Code MCP settings:
“`json
{
“mcpServers”: {
“wordpress”: {
“command”: “npx”,
“args”: [“@automattic/mcp-wordpress-remote”],
“env”: {
“WP_API_URL”: “https://yoursite.com”,
“WP_API_USERNAME”: “your-username”,
“WP_API_PASSWORD”: “your-application-password”,
“LOG_FILE”: “./wordpress-mcp.log”
}
}
}
}
“`
**Replace these placeholders:**
– `https://yoursite.com` – Your actual WordPress URL
– `your-username` – Your WordPress username
– `your-application-password` – The password from the previous step
### JWT Token Alternative
If you prefer JWT tokens for authentication:
“`json
{
“mcpServers”: {
“wordpress”: {
“command”: “npx”,
“args”: [“@automattic/mcp-wordpress-remote”],
“env”: {
“WP_API_URL”: “https://yoursite.com”,
“JWT_TOKEN”: “your-jwt-token”,
“LOG_FILE”: “./wordpress-mcp.log”
}
}
}
}
“`
I stick with application passwords unless I have specific JWT requirements. They’re simpler and just as secure.
## Testing Your Connection
Time for the moment of truth – let’s see if everything works.
### Basic Functionality Test
1. **Restart Claude Code completely** (this step is crucial)
2. **Test post retrieval:**
“`
Show me my recent WordPress posts
“`
3. **Test content creation:**
“`
Create a draft post titled “Testing Claude Code Integration”
“`
If Claude Code successfully shows your posts and creates the draft, you’re all set!
### Common Connection Issues
**Getting 401 or connection errors?**
– Double-check your site URL includes `https://`
– Verify your username and application password are correct
– Confirm the MCP plugin is actually activated
**WordPress MCP not found errors?**
– Restart Claude Code completely and try again
– Check your JSON configuration syntax carefully
– Make sure all brackets and commas are properly placed
**Posts not appearing?**
– Verify your user account has sufficient permissions
– Test with an admin account first to rule out permission issues
– Check if security plugins are blocking API requests
## Advanced Configuration Options
Once the basics work, here are some powerful extensions.
### Managing Multiple WordPress Sites
Handle multiple sites with separate configurations:
“`json
{
“mcpServers”: {
“main-blog”: {
“command”: “npx”,
“args”: [“@automattic/mcp-wordpress-remote”],
“env”: {
“WP_API_URL”: “https://blog.yoursite.com”,
“WP_API_USERNAME”: “blog-user”,
“WP_API_PASSWORD”: “blog-password”
}
},
“portfolio”: {
“command”: “npx”,
“args”: [“@automattic/mcp-wordpress-remote”],
“env”: {
“WP_API_URL”: “https://portfolio.yoursite.com”,
“WP_API_USERNAME”: “portfolio-user”,
“WP_API_PASSWORD”: “portfolio-password”
}
}
}
}
“`
### Local Development Configuration
For local WordPress development environments:
“`json
{
“mcpServers”: {
“local-wordpress”: {
“command”: “npx”,
“args”: [“@automattic/mcp-wordpress-remote”],
“env”: {
“WP_API_URL”: “http://localhost:8080”,
“WP_API_USERNAME”: “admin”,
“WP_API_PASSWORD”: “your-local-password”
}
}
}
}
“`
## Real-World Usage Patterns
Here’s how I actually use this integration daily.
### Content Creation Workflows
**New Post Creation:**
“`
Create a new post about Spring Boot microservices
with an introduction explaining the benefits of microservices architecture
“`
**Content Updates:**
“`
Update the Docker deployment tutorial to include
the new Jenkins pipeline configuration we just implemented
“`
### Content Management Tasks
**Bulk Operations:**
“`
Show me all posts tagged “tutorial” from the last 3 months
“`
**SEO Optimization:**
“`
Update the meta description for the WordPress setup guide
to make it more search-engine friendly
“`
### Development Workflow Integration
**Documentation Generation:**
“`
Create a blog post documenting the new API endpoints
we added to the microservices project
“`
**Release Documentation:**
“`
Generate a post about version 2.1 release features
based on our GitHub release notes
“`
## Security Best Practices
Since you’re giving Claude Code access to your WordPress site, security matters.
### Application Password Management
– Use descriptive names for each application password
– Revoke unused passwords regularly through WordPress admin
– Create separate passwords for different tools and integrations
– Monitor usage patterns through WordPress activity logs
### Access Control Strategy
– Start with minimal permissions and expand as needed
– Consider creating dedicated user accounts for API access
– Regularly audit connected applications and their permissions
– Keep WordPress core and all plugins updated
### Monitoring and Logging
– Enable logging in your MCP configuration for troubleshooting
– Monitor API usage patterns for unusual activity
– Set up alerts for suspicious access patterns
– Maintain regular backups of your site content
## Performance Optimization
Keep everything running smoothly with these tips.
### Efficient API Usage
**Smart Querying:**
– Be specific when requesting posts to reduce server load
– Use filters and limits to control response sizes
– Cache frequently accessed data when possible
**Rate Limiting Awareness:**
– WordPress has built-in rate limiting for API requests
– Don’t hammer the API with rapid successive calls
– Respect your hosting provider’s resource limits
### Resource Management
– Monitor your hosting account’s resource usage
– API calls consume server resources like any other request
– Consider implementing caching strategies for heavy usage scenarios
## Expanding Your Workflow
Once everything’s working, the possibilities are endless.
### Content Automation Ideas
**Social Media Integration:**
– Generate social media posts from blog content
– Create content calendars automatically
– Automate cross-posting to multiple platforms
**Development Documentation:**
– Auto-generate API documentation from code comments
– Create release notes from Git commit messages
– Maintain project status updates automatically
### Analytics and Optimization
**Content Performance:**
– Analyze which posts perform best
– Generate SEO optimization suggestions
– Track content engagement metrics
**Editorial Workflow:**
– Automate content review processes
– Schedule posts based on optimal timing
– Manage editorial calendars programmatically
## Troubleshooting Like a Pro
When things go wrong, here’s how to diagnose issues quickly.
### Log Analysis
Check your log file for detailed error information:
“`bash
tail -f ./wordpress-mcp.log
“`
This shows real-time API communication and error details.
### Manual API Testing
Verify your credentials work outside of Claude Code:
“`bash
curl -u “username:app-password” \
“https://yoursite.com/wp-json/wp/v2/posts?per_page=1”
“`
If this returns post data, your credentials and API access are working correctly.
### Common Gotchas I’ve Learned
**WordPress.com Limitations:**
– Requires Business plan or higher for API access
– Some features may be restricted compared to self-hosted
**Hosting Provider Issues:**
– Some hosts block REST API access by default
– Security settings might interfere with API requests
– Contact support if you suspect hosting-related blocks
**Plugin Conflicts:**
– Security plugins sometimes block API requests
– Caching plugins might interfere with real-time updates
– Test with plugins temporarily disabled to isolate issues
## My Final Thoughts
Setting up Claude Code with WordPress has completely transformed how I manage content. What used to require multiple browser tabs and constant context switching now happens seamlessly in my terminal.
The initial setup takes about 10 minutes, but the productivity gains start immediately. Whether you’re managing a single blog or multiple WordPress sites, this integration pays for itself quickly.
Start with the basic application password setup, test everything thoroughly, and then gradually expand into more advanced workflows. The key is getting the foundation solid before adding complexity.
Most issues I see are simple configuration mistakes or forgetting to restart Claude Code after changes. Double-check your JSON syntax and credentials first – that solves 90% of problems.
Once you’re up and running, you’ll find yourself discovering new ways to integrate WordPress management into your development workflow. The combination of Claude Code’s AI capabilities with WordPress’s flexibility opens up possibilities I’m still exploring.
Happy coding, and enjoy your new WordPress superpowers!