WooCommerce & WordPress Plugin for Claude Code

Manage your WordPress and WooCommerce sites seamlessly through Claude Code without accessing the dashboard.

WooCommerce & WordPress Plugin for Claude Code

Complete WordPress and WooCommerce site management without touching the dashboard. Manage posts, pages, products, orders, media, and more directly through Claude Code.

Features

WordPress Management

  • Content: Create, edit, and delete posts, pages, and custom post types
  • Media: Upload and manage media library items
  • Users: Manage WordPress users and roles
  • Taxonomies: Organize with categories, tags, and custom taxonomies
  • Comments: Moderate and respond to comments
  • Site Settings: Manage menus, widgets, and templates
  • Custom Fields: Full MetaBox integration for managing custom fields via REST API

WooCommerce Management

  • Products: Full CRUD operations, inventory management, variations
  • Orders: View, process, and update order statuses
  • Customers: Manage customer data and profiles
  • Coupons: Create and manage discount codes
  • Shipping: Configure shipping zones and methods

Safety & Security

  • Automatic Backups: Auto-backup before deletions and bulk operations
  • Security Auditing: Proactive scanning for SQL injection, XSS, and vulnerabilities
  • Audit Trail: Complete log of all backups and operations
  • Safe Restore: Preview changes before restoring backups

Multi-Site Support

  • Per-project configuration via .claude/woocommerce-wordpress.local.md
  • Support for WordPress-only sites (WooCommerce optional)
  • Easy switching between different sites/projects

MetaBox Integration (Optional)

  • Custom Fields: Get and update custom fields for posts, pages, CPTs
  • Taxonomy Fields: Manage custom fields for categories, tags, and custom taxonomies
  • User Fields: Add custom data to user profiles
  • Comment Fields: Extend comments with custom metadata
  • Settings Pages: Access and update MetaBox settings pages
  • Auto-Formatting: Complex field types (images, maps) automatically enhanced

Prerequisites

  • Node.js 18+ installed
  • WordPress 5.6+ (for Application Passwords)
  • WooCommerce 3.5+ (if using WooCommerce features)
  • HTTPS enabled on your WordPress site (required for API access)
  • MetaBox plugin + MB REST API extension (optional, for custom fields support)

Installation

1. Install Plugin

Clone or symlink this plugin to Claude Code:

# Option 1: Use directly from this location
cc --plugin-dir ~/Documents/Dev/Claude-Plugins/woocommerce-wordpress

# Option 2: Symlink to user plugins directory
ln -s ~/Documents/Dev/Claude-Plugins/woocommerce-wordpress ~/.claude/plugins/woocommerce-wordpress

2. Install MCP Server Dependencies

cd ~/Documents/Dev/Claude-Plugins/woocommerce-wordpress/mcp-server
npm install

3. Configure Your Project

In your project directory, run:

/wc-wp:init

This will guide you through:

  1. Entering your WordPress site URL
  2. Generating Application Passwords
  3. Generating WooCommerce API keys (if applicable)
  4. Creating .claude/woocommerce-wordpress.local.md configuration

4. Generate Project README

After configuration, generate project-specific setup instructions:

/wc-wp:readme

Quick Start

WordPress Application Password Setup

  1. Log into your WordPress admin dashboard
  2. Go to Users → Profile
  3. Scroll to Application Passwords section
  4. Enter name: "Claude Code"
  5. Click Add New Application Password
  6. Copy the generated password (format: xxxx xxxx xxxx xxxx xxxx xxxx)

WooCommerce API Keys Setup

  1. Log into WordPress admin
  2. Go to WooCommerce → Settings → Advanced → REST API
  3. Click Add Key
  4. Set:
    • Description: "Claude Code"
    • User: Your admin user
    • Permissions: Read/Write
  5. Copy Consumer Key and Consumer Secret

Commands

  • /wc-wp:init - Initialize project configuration
  • /wc-wp:readme - Generate project setup instructions
  • /wc-wp:backup - Create manual backup (full or filtered)
  • /wc-wp:restore - Restore from backup with preview

Skills

The plugin includes four skills that activate automatically:

  1. setup-configuration - Triggers when setting up WordPress/WooCommerce API
  2. content-workflows - Triggers for content management guidance
  3. custom-agent-creation - Triggers when creating project-specific agents
  4. metabox-integration - Triggers when working with MetaBox custom fields

Agents

  • content-workflow-manager - Handles bulk operations, migrations, complex workflows
  • security-auditor - Proactively scans for vulnerabilities before risky operations
  • backup-manager - Advisory agent for backup strategy and orchestration

Backup System

Automatic Backups

Automatic backups are created before:

  • Any deletion operation (posts, products, pages, etc.)
  • Bulk update operations (updating multiple items)

Backups are stored in ./backups/ with both JSON and WordPress WXR formats.

Manual Backups

# Backup entire site
/wc-wp:backup

# Backup only products
/wc-wp:backup --type products

# Backup only posts
/wc-wp:backup --type posts

# Backup specific item
/wc-wp:backup --type product --id 123

Restoring Backups

/wc-wp:restore

This will:

  1. List available backups
  2. Let you select which backup to restore
  3. Preview changes
  4. Confirm before applying

Backup Retention

Backups older than 30 days (configurable) are automatically deleted. Configure in .claude/woocommerce-wordpress.local.md:

backup:
  retention_days: 60  # Keep backups for 60 days

Configuration File

.claude/woocommerce-wordpress.local.md structure:

---
site_url: https://your-site.com
wordpress:
  username: admin
  app_password: xxxx xxxx xxxx xxxx xxxx xxxx
  # OR use environment variable:
  # app_password: ${WP_APP_PASSWORD}
woocommerce:
  enabled: true
  consumer_key: ck_xxxxxxxxxxxxx
  consumer_secret: cs_xxxxxxxxxxxxx
  # OR use environment variables:
  # consumer_key: ${WC_CONSUMER_KEY}
  # consumer_secret: ${WC_CONSUMER_SECRET}
backup:
  auto_backup: true
  storage: ./backups
  format: both  # json, wxr, or both
  retention_days: 30
---

# Project Configuration

Add project-specific notes here.

Security

  • HTTPS Required: All API communication requires HTTPS
  • Application Passwords: Modern WordPress authentication (no plugins required)
  • Automatic Scanning: Security auditor checks all content before publishing
  • Credential Storage: Supports both plain text and environment variables
  • Gitignored: .local.md files are automatically excluded from version control

MCP Tools

The plugin provides comprehensive MCP tools:

WordPress Tools

  • wordpress_get_posts, wordpress_create_post, wordpress_update_post, wordpress_delete_post
  • wordpress_get_pages, wordpress_create_page, etc.
  • wordpress_upload_media, wordpress_get_media, etc.
  • wordpress_get_users, wordpress_create_user, etc.
  • wordpress_get_comments, wordpress_update_comment, etc.
  • wordpress_get_categories, wordpress_create_category, etc.

WooCommerce Tools

  • woocommerce_get_products, woocommerce_create_product, woocommerce_update_product, woocommerce_delete_product
  • woocommerce_get_orders, woocommerce_update_order_status, etc.
  • woocommerce_get_customers, woocommerce_create_customer, etc.
  • woocommerce_get_coupons, woocommerce_create_coupon, etc.

MetaBox Tools

  • metabox_get_post_fields, metabox_update_post_fields - Custom fields for posts/pages/CPTs
  • metabox_get_term_fields, metabox_update_term_fields - Custom fields for taxonomies
  • metabox_get_user_fields, metabox_update_user_fields - Custom fields for users
  • metabox_get_comment_fields, metabox_update_comment_fields - Custom fields for comments
  • metabox_get_settings_page, metabox_update_settings_page - Settings page management

Backup Tools

  • backup_create - Create backups (full/filtered/individual)
  • backup_list - List available backups
  • backup_restore - Restore from backup
  • backup_delete - Delete old backups

Utility Tools

  • check_connection - Test API connectivity

Troubleshooting

"Authentication failed"

  • Verify Application Password is correct (no extra spaces)
  • Ensure HTTPS is enabled on your site
  • Check username matches WordPress admin username

"WooCommerce not found"

  • Set woocommerce.enabled: false in .local.md if site doesn't have WooCommerce
  • Verify WooCommerce plugin is active
  • Check WooCommerce API keys are correct

"Backup failed"

  • Ensure ./backups/ directory exists and is writable
  • Check disk space
  • Review ./backups/backup-log.md for details

"Connection timeout"

  • Verify site URL is correct (include https://)
  • Check site is accessible from your network
  • Increase timeout in MCP server configuration

MetaBox Custom Fields Usage

Prerequisites

  1. Install MetaBox plugin on your WordPress site
  2. Install MB REST API extension
  3. Configure WordPress authentication (see setup above)

Getting Custom Fields

// Get custom fields for a post
metabox_get_post_fields({
  post_type: "posts",
  id: 123
})

// Get custom fields for a WooCommerce product
metabox_get_post_fields({
  post_type: "product",
  id: 456
})

// Get custom fields for a category
metabox_get_term_fields({
  taxonomy: "categories",
  id: 10
})

Updating Custom Fields

// Update post custom fields
metabox_update_post_fields({
  post_type: "posts",
  id: 123,
  fields: {
    author_bio: "Orlando Bruno is a data scientist...",
    reading_time: 5,
    featured_flag: true
  }
})

// Update WooCommerce product custom fields
metabox_update_post_fields({
  post_type: "product",
  id: 456,
  fields: {
    warranty_period: "24 months",
    supplier_name: "Acme Corp",
    eco_certified: true
  }
})

Working with Settings Pages

// Get site-wide settings
metabox_get_settings_page({
  id: "site-options"
})

// Update site settings
metabox_update_settings_page({
  id: "site-options",
  fields: {
    footer_text: "© 2025 Orlando Bruno",
    analytics_id: "UA-123456-1"
  }
})

For complete MetaBox documentation, see the metabox-integration skill.

Examples

See the /skills/ directory for practical examples and utility scripts.

License

MIT

Author

Orlando Bruno


Version: 0.1.0 Last Updated: 2025-12-25