<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://www.valera.codes/blog/rss.xml" rel="self" type="application/atom+xml" /><link href="https://www.valera.codes/" rel="alternate" type="text/html" hreflang="en-US" /><updated>2026-09-26T00:27:34+02:00</updated><id>https://www.valera.codes/blog/rss.xml</id><title type="html">Valerii Vasyliev | Blog</title><subtitle>Certified Codeable Expert Developer with 20+ years building high-performance WordPress solutions, leading teams, and delivering results for clients worldwide.</subtitle><author><name>Valerii Vasyliev</name></author><entry><title type="html">Managing a WordPress Website with Claude Code</title><link href="https://www.valera.codes/blog/managing-wordpress-with-claude-code/" rel="alternate" type="text/html" title="Managing a WordPress Website with Claude Code" /><published>2026-09-24T00:00:00+02:00</published><updated>2026-09-24T00:00:00+02:00</updated><id>https://www.valera.codes/blog/managing-wordpress-with-claude-code</id><content type="html" xml:base="https://www.valera.codes/blog/managing-wordpress-with-claude-code/"><![CDATA[<p>Most WordPress maintenance is repetitive: check what needs updating, look at the error log, find out why a page got slow, clean up a bloated options table, publish a batch of content. Each step is small, but the context-switching adds up, especially when you look after several sites.</p>

<p>Claude Code can take over a lot of that work, provided it can actually see and operate the site. This post shows how to do that with <a href="https://github.com/lwplugins/lw-site-manager">LW Site Manager</a>, a WordPress plugin that exposes site-management operations to AI tools, and how to keep the workflow safe enough to use on production.</p>

<h2 id="what-claude-code-is">What Claude Code is</h2>

<p><a href="https://docs.claude.com/en/docs/claude-code/overview">Claude Code</a> is Anthropic’s command-line coding agent. You run it in a terminal inside a project directory, describe a task in plain language, and it reads files, runs commands, edits code and reports back. It works in a loop: inspect, plan, act, verify.</p>

<p>Two properties make it useful for WordPress management rather than only for writing code:</p>

<ul>
  <li><strong>It can use tools.</strong> Through the Model Context Protocol (MCP), Claude Code can call external services — a WordPress site, in our case — the same way it runs shell commands.</li>
  <li><strong>It can be constrained.</strong> A <code class="language-plaintext highlighter-rouge">CLAUDE.md</code> file in the project root gives it standing instructions: which site it is working on, what it may and may not do without asking, how you want changes reported.</li>
</ul>

<p>On its own, Claude Code knows nothing about your site. It needs a way in.</p>

<h2 id="what-lw-site-manager-is">What LW Site Manager is</h2>

<p><a href="https://github.com/lwplugins/lw-site-manager">LW Site Manager</a> (“WordPress Site Manager with Abilities API — AI-ready site maintenance”) is a GPL-2.0 plugin by LW Plugins. It builds on the WordPress Abilities API and registers a large set of <em>abilities</em>: discrete, described operations such as <code class="language-plaintext highlighter-rouge">check-updates</code>, <code class="language-plaintext highlighter-rouge">update-plugin</code>, <code class="language-plaintext highlighter-rouge">create-backup</code>, <code class="language-plaintext highlighter-rouge">flush-cache</code> or <code class="language-plaintext highlighter-rouge">list-posts</code>. At the time of writing the README lists 167 of them, grouped roughly as:</p>

<ul>
  <li><strong>Updates</strong> — check, update core, plugins, themes, or everything.</li>
  <li><strong>Plugins and themes</strong> — list, install, activate, deactivate, delete.</li>
  <li><strong>Content</strong> — posts, pages, comments and media (create, read, update, delete).</li>
  <li><strong>Users and taxonomy</strong> — user management, categories, tags, custom taxonomies.</li>
  <li><strong>Settings</strong> — general, reading, discussion, permalinks, homepage.</li>
  <li><strong>Backup and database</strong> — create and restore backups, optimise tables, clean up.</li>
  <li><strong>Cache</strong> — flush the caches of the common caching plugins and Redis/Varnish.</li>
  <li><strong>Health</strong> — health checks, error logs, pending plugin database updates.</li>
  <li><strong>WooCommerce</strong> — products, orders, variations, reports, refunds, shipping.</li>
</ul>

<p>Every ability is reachable over the REST API, and the plugin ships a built-in <strong>MCP server</strong> that exposes the same abilities to AI clients. That MCP server is the bridge to Claude Code.</p>

<p>Requirements, per the repository: PHP 8.1+, WordPress 6.9+ and the WordPress Abilities API.</p>

<h2 id="how-the-two-connect">How the two connect</h2>

<p>The plugin’s MCP server lives at <code class="language-plaintext highlighter-rouge">https://YOUR-SITE/wp-json/mcp/lw-site-manager</code>. It is <strong>off by default</strong>; you enable it in the WordPress admin under <strong>LW Plugins → AI / MCP</strong>. Authentication uses a standard WordPress Application Password for an administrator account, sent as HTTP Basic auth.</p>

<p>Claude Code reads MCP servers from a <code class="language-plaintext highlighter-rouge">.mcp.json</code> file in your project. The repository’s documented configuration is:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"mcpServers"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="nl">"lw-site-manager"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://YOUR-SITE/wp-json/mcp/lw-site-manager"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"headers"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="nl">"Authorization"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Basic BASE64(username:application_password)"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>Once that is in place, “check what needs updating on the site” becomes a tool call Claude Code can make, and “update plugin X” becomes another. It can chain them: check → back up → update → run the health check → report.</p>

<p>Keep the <code class="language-plaintext highlighter-rouge">.mcp.json</code> with real credentials out of version control. An Application Password for an administrator is as sensitive as the administrator’s login.</p>

<h2 id="tasks-worth-delegating">Tasks worth delegating</h2>

<p>Good candidates share two traits: they are well-defined, and the outcome is easy to verify.</p>

<ul>
  <li><strong>Audits.</strong> Inventory of theme, plugins, versions, settings, and an architecture summary you can paste into a handover document.</li>
  <li><strong>Update runs.</strong> Check for updates, back up, update, verify, and write the change log entry.</li>
  <li><strong>Debugging.</strong> Read the error log, correlate with recent changes, propose a fix.</li>
  <li><strong>Performance triage.</strong> Find the expensive plugins, autoloaded options and cache misconfiguration before you open a profiler.</li>
  <li><strong>Database hygiene.</strong> Identify large tables, orphaned metadata and transient build-up.</li>
  <li><strong>Content operations.</strong> Bulk-create or update posts and pages following the site’s existing conventions.</li>
  <li><strong>WooCommerce housekeeping.</strong> Reports, stock and order lookups, catalogue fixes.</li>
</ul>

<p>Tasks that are a poor fit: anything with an ambiguous goal, and anything you cannot check afterwards.</p>

<h2 id="why-this-matters-for-developers-and-agencies">Why this matters for developers and agencies</h2>

<p>The gain is not that the AI is smarter than you at WordPress. It is that the inspect-and-report part of every maintenance task — the part that is mostly reading — becomes cheap, so you spend your attention on decisions. For an agency running twenty sites, a consistent monthly audit that used to be skipped for lack of time becomes a prompt. Because every ability is described and logged, the work is also more reproducible than a person clicking through wp-admin.</p>

<h2 id="review-before-production-always">Review before production, always</h2>

<p>Claude Code will happily execute a plan that is subtly wrong. Treat it like a capable junior colleague with a production login: useful, fast, and in need of a review step.</p>

<ul>
  <li><strong>Read-only first.</strong> Start every engagement with audits and investigations. Only grant write operations once you trust the output.</li>
  <li><strong>Backup before change.</strong> LW Site Manager has <code class="language-plaintext highlighter-rouge">create-backup</code> and <code class="language-plaintext highlighter-rouge">backup-status</code>; make the backup a mandatory first step in any prompt that changes state.</li>
  <li><strong>Plan, then approve.</strong> Ask for a plan and read it before saying “go”. This is where most mistakes are caught.</li>
  <li><strong>Staging when you can.</strong> If a staging environment exists, run the change there first with the same prompt.</li>
  <li><strong>Explicit confirmation for destructive operations.</strong> Deleting plugins, users, content, database rows or backups should never happen inside a single “just fix it” instruction. Put this rule in <code class="language-plaintext highlighter-rouge">CLAUDE.md</code> so it applies to every session.</li>
</ul>

<h2 id="a-simple-recommended-workflow">A simple recommended workflow</h2>

<ol>
  <li><strong>Inspect.</strong> Ask Claude Code to look at the site and describe what it finds — versions, plugins, settings, recent errors.</li>
  <li><strong>Analyse.</strong> State the change you want and ask it to work out what is involved and what could break.</li>
  <li><strong>Plan.</strong> Have it propose a step-by-step plan, including the backup and the verification steps. Read it.</li>
  <li><strong>Implement.</strong> Approve the plan, or the parts of it you agree with.</li>
  <li><strong>Check.</strong> Run the health check, hit the affected pages, look at the error log.</li>
  <li><strong>Review.</strong> Read the summary of what changed and compare it with the plan.</li>
  <li><strong>Apply.</strong> Deploy or, if you worked on staging, repeat on production with the same prompt.</li>
</ol>

<p>Steps 1–3 are read-only. If a task never gets past step 3, nothing on the site has changed.</p>

<h2 id="useful-claude-code-prompts">Useful Claude Code prompts</h2>

<p>These are copy-paste starting points. Each one tells Claude Code to inspect before acting, and the ones that change state ask for a plan and a backup first. Adjust the site name and specifics.</p>

<h3 id="website-audit">Website audit</h3>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Using the lw-site-manager MCP tools, inspect this WordPress installation without changing anything. Report: WordPress version, PHP version, active theme (and parent theme), active and inactive plugins with versions and available updates, key settings (permalinks, reading, discussion, homepage), caching setup, and anything the health check flags. Then summarise the site's architecture in a few paragraphs and list potential issues ordered by severity. Do not make any changes.
</code></pre></div></div>

<h3 id="plugin-investigation">Plugin investigation</h3>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Investigate the plugin "PLUGIN-NAME" on this site. Do not modify anything. Explain what the plugin does and which parts of the site depend on it. Check its version against the latest available, look for known compatibility issues with our WordPress and PHP versions, and assess its impact on performance and security based on what you can observe (hooks, scheduled events, database tables or options it owns, assets it enqueues). Finish with recommendations, clearly separated into "safe to do now" and "needs discussion".
</code></pre></div></div>

<h3 id="debugging">Debugging</h3>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Pages under /shop/ return a 500 error since yesterday. Investigate the root cause without changing anything yet. Read the recent error log entries, identify the plugin or theme code involved, and correlate with recent updates or setting changes. Explain the likely root cause, the evidence for it, and the fix you propose, including any risk. Wait for my confirmation before applying anything.
</code></pre></div></div>

<h3 id="performance">Performance</h3>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Analyse this site's performance without making changes. Look for: plugins that add heavy front-end assets or admin-ajax/cron load, expensive hooks on every request, large or unindexed database tables, autoloaded options over 1 MB in total, transients that never expire, and caching that is disabled, misconfigured or bypassed. Report findings ordered by likely impact, with the evidence for each, and propose fixes as a plan I can approve item by item.
</code></pre></div></div>

<h3 id="database">Database</h3>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Investigate the WordPress database read-only. Report the largest tables with row counts and sizes, the total size of autoloaded options and the biggest individual ones, orphaned post/term/user meta, expired transients, revision and spam/trash counts, and any tables left behind by removed plugins. Recommend clean-up steps with the expected space saving. Do NOT delete, truncate or optimise anything. Any destructive database operation requires my explicit confirmation of the exact step, after a backup.
</code></pre></div></div>

<h3 id="security">Security</h3>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Perform a basic security review of this site without changing anything. Check: outdated core, plugins and themes; inactive plugins and themes that should be removed; user accounts with administrator role and weak or default usernames; whether XML-RPC is enabled; whether PHP execution is possible in wp-content/uploads; file editing in the admin; debug mode and display_errors in production; file and directory permissions where you can observe them; and any suspicious scheduled events, options or recently modified files. Report each finding with severity and a recommended fix.
</code></pre></div></div>

<h3 id="content-management">Content management</h3>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>I need five new blog posts from the outlines in content-briefs.md. First inspect the existing posts: categories, tags, typical length and heading structure, featured image usage, excerpt conventions and SEO fields. Then draft each post as a WordPress draft (not published) following those conventions, using the same author and category scheme. Give me the list of draft URLs to review. Do not publish.
</code></pre></div></div>

<h3 id="production-change">Production change</h3>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Prepare the following production change: update the "PLUGIN-NAME" plugin to the latest version. Before anything else: run the health check, confirm a fresh backup with create-backup and wait for backup-status to report success, and record the current plugin version. Then apply the update, flush the cache, run the health check again, load the homepage and /shop/ and confirm they return 200 with no new errors in the log. Finish with a concise deployment report: what changed, from which version to which, checks performed and their results, and the backup identifier to restore from. If any check fails, stop and report instead of continuing.
</code></pre></div></div>

<h2 id="getting-started">Getting started</h2>

<p>At a high level, the setup is:</p>

<ol>
  <li><strong>Install Claude Code</strong> following the <a href="https://docs.claude.com/en/docs/claude-code/overview">official documentation</a>, and run it once in a project folder you will dedicate to the site (a <code class="language-plaintext highlighter-rouge">CLAUDE.md</code> with your rules lives there).</li>
  <li><strong>Install LW Site Manager</strong> on the WordPress site. Per the repository: <code class="language-plaintext highlighter-rouge">composer require lwplugins/lw-site-manager</code>, or download the latest release from GitHub, upload it to <code class="language-plaintext highlighter-rouge">wp-content/plugins/lw-site-manager</code> and activate it. The site needs PHP 8.1+, WordPress 6.9+ and the Abilities API.</li>
  <li><strong>Enable the MCP server and create credentials.</strong> In wp-admin go to <strong>LW Plugins → AI / MCP</strong> and turn the MCP server on. Under <strong>Users → Profile → Application Passwords</strong> create a password for an administrator account and base64-encode <code class="language-plaintext highlighter-rouge">username:app_password</code>.</li>
  <li><strong>Point Claude Code at the site.</strong> Add the <code class="language-plaintext highlighter-rouge">.mcp.json</code> shown above to the project folder with your URL and encoded credentials, and keep that file out of git.</li>
  <li><strong>Verify read access.</strong> Start Claude Code and ask it to list the site’s plugins or run <code class="language-plaintext highlighter-rouge">check-updates</code>. If the tool call succeeds, the connection works.</li>
  <li><strong>Start read-only.</strong> Run the audit prompt above and a couple of investigations before you let it change anything. Write your rules into <code class="language-plaintext highlighter-rouge">CLAUDE.md</code>: which site this is, backup before every write, no destructive operations without explicit confirmation.</li>
</ol>

<p>The repository has the full ability list, REST examples and a changelog: <a href="https://github.com/lwplugins/lw-site-manager">github.com/lwplugins/lw-site-manager</a>.</p>

<h2 id="closing-note">Closing note</h2>

<p>The tools are new; the discipline is not. Inspect before you change, back up before you write, read the plan before you approve it, and verify after. Claude Code with LW Site Manager makes the inspecting and the reporting nearly free — which is exactly what leaves you time to do the reviewing properly.</p>]]></content><author><name>Valerii Vasyliev</name></author><category term="WordPress" /><category term="Claude Code" /><category term="AI" /><category term="MCP" /><summary type="html"><![CDATA[A practical introduction to running WordPress maintenance through Claude Code and the LW Site Manager plugin: what the tools are, how they connect, which tasks to delegate, and a workflow that keeps production safe.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.valera.codes/assets/img/og-image.png" /><media:content medium="image" url="https://www.valera.codes/assets/img/og-image.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>