Skip to content

Repository files navigation

Claude Code WordPress Plugin

Claude Code WordPress Plugin

Control your entire WordPress website using plain English.
An AI-powered admin tool that connects Claude (by Anthropic) to your WordPress dashboard.

Version 2.0.0 WordPress 6.0+ PHP 7.4+ License: CC BY-NC 4.0


What is this?

Imagine being able to tell your WordPress website what to do in plain English, just like chatting with a friend. That's exactly what this plugin does.

Instead of clicking through dozens of menus, editing code, or learning complicated settings, you simply type what you want:

"Create a new blog post about summer recipes and publish it"

"Install the WooCommerce plugin and activate it"

"Show me all users who registered this month"

"Change the site title to My Awesome Blog"

The plugin understands your request, figures out what needs to happen, and does it for you. It's like having a WordPress expert sitting right inside your dashboard, available 24/7.

How does it work?

Here's a simple breakdown:

  1. You type a message in the chat terminal inside your WordPress admin area
  2. The plugin sends your message to Claude (an AI made by a company called Anthropic)
  3. Claude figures out what WordPress actions need to happen
  4. The plugin executes those actions on your site using WordPress's built-in systems
  5. You see the results right in the chat window

Everything happens inside your WordPress dashboard. You never have to leave your admin area.

What you need before starting

  • A WordPress website (version 6.0 or newer)
  • PHP 7.4 or newer on your web server (most modern hosts have this)
  • An Anthropic API key (this is how the AI is powered — more on this below)

What is an API key?

An API key is like a password that lets this plugin talk to Claude (the AI). You get one for free by signing up at console.anthropic.com. Anthropic charges a small fee based on how much you use the AI — think of it like a pay-as-you-go phone plan. Most casual users spend less than a few dollars per month.

This plugin itself is completely free. You only pay Anthropic for the AI usage.


Installation

Method 1: Upload via WordPress Admin (Easiest)

  1. Download this repository as a ZIP file (click the green Code button above, then Download ZIP)
  2. Log in to your WordPress admin dashboard
  3. Go to Plugins > Add New > Upload Plugin
  4. Choose the ZIP file you downloaded and click Install Now
  5. Click Activate Plugin

Method 2: Upload via FTP / File Manager

  1. Download and unzip this repository
  2. Upload the claude-code-wordpress-plugin folder to /wp-content/plugins/ on your server
  3. Go to Plugins in your WordPress admin and click Activate next to "Claude Code WordPress Plugin"

First-time setup

After activating the plugin:

  1. Look for Claude Code in your WordPress admin sidebar (left side of the screen)
  2. Click Claude Code > Settings
  3. Paste your Anthropic API key into the API Key field
  4. Click Validate to make sure the key works (you should see a green checkmark)
  5. Click Save Settings
  6. Go to Claude Code > Terminal — this is where you chat with Claude!

What can it do?

Content Management

Create, edit, delete, and manage blog posts, pages, and custom content — all through natural language.

You say... What happens
"Create a draft post titled 'Hello World' with some welcome content" A new draft post is created
"Publish all my draft posts" All drafts are switched to published
"Delete the post called 'Old News'" That post is moved to trash
"List my 10 most recent posts" Shows a table of your latest posts

Theme Management

Switch themes, view theme files, and modify customizer settings.

You say... What happens
"What theme am I using?" Shows your active theme info
"Show me the available themes" Lists all installed themes
"Read the header.php file from my theme" Displays the file contents

Plugin Management

Install, activate, deactivate, update, and remove plugins from the WordPress.org repository.

You say... What happens
"Install Contact Form 7" Downloads and installs the plugin
"Activate WooCommerce" Turns on the WooCommerce plugin
"Show me all installed plugins" Lists every plugin with its status
"Update all plugins" Updates everything to the latest version

User Management

Create users, change roles, and manage accounts.

You say... What happens
"Create a new editor account for john@example.com" New user is created with the Editor role
"List all administrators" Shows all admin users
"Change john's role to subscriber" Updates the user's role

WooCommerce Integration

If you run an online store with WooCommerce, the plugin automatically detects it and adds store management capabilities.

You say... What happens
"Create a product called 'Blue T-Shirt' priced at $29.99" New product is created
"Show me today's sales report" Displays order totals and revenue
"Set all products in the 'Sale' category to 20% off" Bulk price update
"What's the stock level for product #42?" Shows inventory info

SEO Integration

Works with both Yoast SEO and RankMath to manage your search engine optimization.

You say... What happens
"What's the SEO title for my homepage?" Shows the configured meta title
"Set the meta description for post 'About Us'" Updates the SEO description
"Audit the SEO for my latest 10 posts" Checks for missing titles, descriptions, etc.

Database Queries

Run safe read-only queries to inspect your data. Write access is disabled by default for safety.

You say... What happens
"How many posts do I have?" Runs a COUNT query and shows the result
"Show me the last 5 entries in the options table" Displays a formatted table
"List all database tables" Shows every table with row counts

File Operations

Read and edit files within your wp-content directory. Core WordPress files are protected and cannot be modified.

You say... What happens
"Show me my .htaccess file" Displays the file contents
"Add a CSS rule to hide the admin bar" Adds custom CSS via the customizer
"Search for 'deprecated' in all theme files" Finds matching lines

Backup & Rollback

Automatic backups are created before any destructive operation (deleting posts, changing themes, etc.). You can also create manual backups.

You say... What happens
"Create a backup" Saves current state
"Show my backups" Lists all backup points
"Restore the last backup" Rolls back to the previous state

Diagnostics

Built-in tools to check your site's health.

You say... What happens
"Run a site health check" Checks server config, PHP version, etc.
"Find unused images in the media library" Locates orphaned media files
"Check for broken links" Scans posts for dead links

Telegram Notifications (Optional)

Connect a Telegram bot to receive notifications about orders, security events, plugin updates, and scheduled tasks on your phone.

Extension System

Install community-built extensions to add new capabilities to Claude. Extensions can connect to external APIs via MCP (Model Context Protocol) bridges and add new tools the AI can use.


Safety Features

This plugin takes security seriously. Here's what protects you:

Feature What it does
Automatic Backups Before deleting anything, the plugin saves a backup you can restore
Confirmation Prompts Dangerous actions (like deleting posts) ask you to confirm first
Activity Logging Every single action is recorded with who did it, when, and what happened
Rate Limiting Limits how many requests can be sent per minute to prevent abuse
IP Whitelist Optionally restrict access to specific IP addresses
Encrypted API Key Your Anthropic API key is encrypted at rest using WordPress security salts
File Protection Cannot edit WordPress core files (wp-admin, wp-includes, wp-config.php)
Database Safety DROP, TRUNCATE, and ALTER commands are always blocked
Role-based Access Only administrators can use the plugin by default
Session Management Inactive sessions are automatically cleaned up

Terminal Interface

The chat terminal is designed to be simple and powerful:

  • Dark theme — easy on the eyes during long sessions
  • Markdown support — responses include formatted text, tables, and code blocks
  • Syntax highlighting — code snippets are color-coded for readability
  • Streaming responses — see Claude's reply as it's being generated (not all at once)
  • Command history — press the up/down arrow keys to recall previous messages
  • Keyboard shortcuts — Enter to send, Shift+Enter for a new line, Ctrl+L to clear
  • Copy button — one-click copy on any code block
  • File attachments — drag and drop files (images, code, text) into the chat
  • Mobile friendly — works on tablets and large phones

Settings

The Settings page lets you customize everything:

Setting What it controls
API Key Your Anthropic API key
Model Which Claude model to use (Sonnet for speed, Opus for complex tasks)
Max Tokens Maximum response length
Session Timeout How long before an inactive chat session expires
Rate Limit Maximum requests per minute per user
File Editing Enable or disable the ability to edit files
Database Write Enable or disable write queries (disabled by default)
Plugin Management Enable or disable installing/removing plugins
Confirmation Prompts Toggle the "are you sure?" prompts
Auto Backup Toggle automatic backups before destructive actions
Backup Retention How many days to keep backups
Log Retention How many days to keep activity logs

Performance

This plugin is designed to have zero impact on your website's speed:

  • Frontend: No CSS, JavaScript, or PHP code runs on your public-facing pages. Your visitors will never notice the plugin is installed.
  • Backend: Plugin code only loads on its own admin pages. Other WordPress admin pages are unaffected.
  • Lazy Loading: The AI tool definitions (96 tools) are only loaded when you actually start a chat, not on every page load.
  • Cron Jobs: Cleanup tasks run on WordPress's built-in scheduler, not on every page request.

External Service Disclosure

This plugin connects to the Anthropic API (api.anthropic.com) to process your messages using Claude AI models.

When you send a message through the terminal:

  • Your message and conversation history are sent to the Anthropic API
  • Basic WordPress site info (version, active theme, active plugins) is included so Claude understands your setup
  • No personal user data beyond what you type is transmitted
  • No telemetry, analytics, or tracking of any kind is included in this plugin

By using this plugin, you agree to Anthropic's Terms of Service, Privacy Policy, and Acceptable Use Policy.


Frequently Asked Questions

Is this safe to use? Yes. The plugin includes automatic backups, confirmation prompts, activity logging, rate limiting, and role-based access control. That said, always maintain your own independent backups and test on a staging site first.

How much does the AI cost? The plugin is free. You pay Anthropic directly for API usage. Most casual users spend $1-5/month. You can set a monthly usage limit in Settings.

Can it break my site? Like any powerful tool, misuse can cause issues. The automatic backup system protects you — every destructive action creates a restore point. We strongly recommend testing on a staging/development site first.

Does it work with my theme/plugins? Yes. The plugin works with any WordPress theme and is compatible with WooCommerce, Yoast SEO, RankMath, and thousands of other plugins. It uses standard WordPress APIs for all operations.

Who can use the plugin on my site? By default, only administrators. You can configure this in Settings.

Can I use it on multiple sites? Yes. Install it on as many sites as you want. Each site needs its own API key configuration.


Requirements

Requirement Minimum
WordPress 6.0
PHP 7.4
MySQL 5.6 (or MariaDB 10.0)
OpenSSL Required (for API key encryption)
Anthropic API Key Required

Changelog

v2.0.0 — Agentic Architecture & Extensions

  • Complete rewrite with autonomous agent loop (multi-step reasoning)
  • 96 built-in tools across 15 categories
  • Extension system for community-built add-ons
  • MCP (Model Context Protocol) bridge support
  • Telegram bot notifications
  • Performance-optimized lazy loading
  • Comprehensive security hardening (SSRF protection, path traversal prevention, XSS mitigation)
  • WooCommerce deep integration
  • SEO plugin integration (Yoast + RankMath)

v1.0.0 — Initial Release

  • Terminal chat interface with streaming responses
  • Content, theme, plugin, user, menu, media, and taxonomy management
  • File operations and database queries
  • Backup and rollback system
  • Activity logging and audit trail
  • Settings page with full configuration

Project Structure

claude-code-wordpress-plugin/
├── claude-code-wordpress-plugin.php   # Main plugin file & autoloader
├── uninstall.php                      # Clean uninstall handler
├── admin/                             # Admin page classes
├── assets/
│   ├── css/                           # Stylesheets (terminal, settings, extensions)
│   ├── js/                            # JavaScript (terminal, command handler, extensions)
│   └── images/                        # Plugin icon
├── handlers/                          # Tool execution handlers (content, theme, media, etc.)
├── includes/                          # Core classes (agent loop, tool registry, security, etc.)
├── rest-api/                          # REST API endpoints (chat, settings, backups, telegram)
└── templates/                         # Admin page templates

Built With

  • WordPress — The world's most popular website platform
  • Anthropic Claude API — The AI that powers natural language understanding
  • PHP 7.4+ — Server-side language
  • Vanilla JavaScript — No framework dependencies for the frontend

Author

Vidura Atupelage


📫 Contact & Support

Have a vibe-coding project you'd like to collaborate on? Get in touch: rawanaholdingslk@gmail.com

If my work helped you, you can support me:

  • USDT (ERC-20): 0xfba2de3360ae0d98ec44216191d143bc28676af5
  • USDC (ERC-20): 0xfba2de3360ae0d98ec44216191d143bc28676af5
  • BTC: 14EVe4ejvXrSS6s34AUBP9TMoSsuzShJ8o

About

Full AI-powered WordPress site management. Connect Claude to your dashboard and control everything with natural language.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages