Work Pricing FAQ Blog Jobs Trending Book the AI Audit

HomeBlogHow to Automate WordPress Admin Tasks with Claude Code

How to Automate WordPress Admin Tasks with Claude Code

I've been working with WordPress sites for Vancouver clients for years, and one thing never changes: admin work piles up. Bulk editing post categories. Updating metadata across hundreds of pages. Scheduling content in advance. Migrating old posts to a new taxonomy structure. None of it is hard—it's just tedious and takes hours you'd rather spend on strategy or client calls.

Over the past six months I've been using Claude Code to automate most of that WordPress admin work. Not through plugins—through direct scripting against the WordPress database and REST API. It's faster, cleaner, and cheaper than stacking premium plugins that slow down your site and charge annual fees.

Here's how I'm doing it, what's working, and where to start if you want to try this approach yourself.

Why Automate WordPress Tasks with Claude Code?

WordPress has plugins for almost everything, and many of them work fine. But they come with trade-offs. Every plugin you install adds weight to your site—more database queries, more potential conflicts, more attack surface for security issues. And premium plugins that handle bulk edits or advanced automation often cost $100–$300 per year per site.

Claude Code gives you a different path. Instead of relying on a plugin to do the work, you write a script that talks directly to your WordPress database or uses the built-in REST API. The script does exactly what you need—no extra features, no bloat—and once it's written, you can run it as many times as you want at no additional cost.

The three biggest advantages I've seen:

  • Speed — A script that updates 200 posts runs in seconds. Doing the same work manually in the WordPress admin takes hours.
  • Precision — You control exactly what changes, with validation rules built in. No accidental bulk changes that break things.
  • Cost — Once you've built the automation, the only ongoing cost is your server resources. No recurring subscription fees.

This approach isn't for every WordPress user—if you're not comfortable with code or SSH access, plugins are still the better choice. But if you're a consultant, agency, or business owner managing multiple WordPress sites, the ROI is strong.

The Most Common WordPress Admin Tasks I Automate

Not every admin task is worth automating. If you only need to do it once or twice, manual work is faster. But for repeating workflows—especially on sites with hundreds or thousands of posts—automation pays for itself quickly.

Here are the five tasks I automate most often for clients:

1. Bulk Updating Post Metadata

A client migrates to a new SEO plugin and needs to transfer meta descriptions from the old plugin's custom fields to the new one's format. Doing this manually means opening each post, copying the value, pasting it into the new field, and saving. For 300 posts, that's a full day of work.

With Claude Code, I write a script that queries all posts with the old custom field, reads the value, writes it to the new field, and logs any errors. The entire migration runs in under two minutes.

2. Scheduled Content Updates

A real estate client wants to automatically mark listings as "sold" after 90 days if no manual update has been made. WordPress doesn't have built-in logic for this kind of conditional status change.

I built a script that runs daily via cron, checks the publish date of posts in the "listings" category, and updates the custom field status if the post is older than 90 days. The script emails a summary of changes so the client can review what happened.

3. Category and Tag Migration

Another common scenario: a site restructure where old category slugs need to be mapped to new ones without breaking internal links or losing SEO value. WordPress has a built-in taxonomy migration tool, but it's clunky and doesn't handle edge cases well.

A Claude Code script can read a mapping file (old slug → new slug), update all post assignments, redirect the old category archive URLs, and generate a report of what changed. This kind of migration used to take a full workday. Now it takes about 90 minutes to write and test the script, then seconds to run it.

4. Bulk Post Duplication for A/B Testing

A marketing client wanted to test two different headline styles across their blog. They needed duplicate versions of 50 posts—same content, different title and slug—published as drafts for review.

Instead of manually duplicating posts one by one in the WordPress admin, I wrote a script that clones the post data, appends "-variant-b" to the slug, updates the title, sets the status to draft, and logs the new post IDs. Total time: 20 minutes to write the script, 10 seconds to run it.

5. Content Audit Reports

This one isn't technically an "admin task," but it's something I run regularly for clients. A script that pulls all published posts, extracts word count, last modified date, featured image status, and internal link count, then exports everything to a CSV for analysis.

This kind of audit used to require exporting posts, manually checking each one in the editor, and compiling the data in a spreadsheet. Now it's automated and runs whenever the client needs an updated report.

How to Actually Build These Automations

The technical approach depends on your server access and comfort level. There are two main paths:

Option 1: Direct Database Access via PHP Script

If you have SSH or SFTP access to your WordPress hosting, you can write a PHP script that uses WordPress's built-in functions. You drop the script in your theme folder (or a custom plugin folder), run it once via command line or browser, and delete it when you're done.

This method is faster for bulk operations because you're working directly with the database. It also gives you access to all of WordPress's internal functions—wp_insert_post(), update_post_meta(), wp_set_object_terms()—so you don't have to write raw SQL.

Here's the rough structure I use:

require_once('/path/to/wp-load.php');

$args = array(
  'post_type' => 'post',
  'posts_per_page' => -1,
  'post_status' => 'publish'
);

$posts = get_posts($args);

foreach ($posts as $post) {
  // Your automation logic here
  // e.g., update_post_meta($post->ID, 'new_field', 'value');
}

echo "Updated " . count($posts) . " posts.";

Claude Code helps by writing the logic inside that loop—validation checks, conditional updates, error handling—based on the specific task you describe.

Option 2: WordPress REST API via Python or Node Script

If you don't have SSH access, or if you prefer working outside the WordPress environment, you can use the WordPress REST API. This approach works from anywhere—your local machine, a separate server, a scheduled task on a cloud function.

You authenticate with an application password (WordPress has this built in as of version 5.6), then make HTTP requests to endpoints like /wp-json/wp/v2/posts to read and update content.

The REST API is slower for large batch operations because each post requires a separate HTTP request. But it's more portable and doesn't require direct server access, which makes it a good fit for managed WordPress hosts that restrict file access.

What Claude Code Can't Do (Yet)

I want to be clear about the limits here, because I've seen people try to over-automate and create more problems than they solve.

Claude Code can't replace plugins that add new functionality to WordPress—things like e-commerce, form builders, or membership systems. It's great for automating repetitive admin work, but it's not a substitute for tools that extend what WordPress can do.

It also won't automatically know your site's custom post type structure, your specific taxonomy setup, or your hosting environment's quirks. You still need to understand how your WordPress site is configured before you can automate it effectively. If you're not sure what custom fields exist or how your content is organized, you'll need to audit that first.

And finally: backup before you run any bulk operation. WordPress doesn't have an undo button. A script that updates 500 posts can't be easily reversed if something goes wrong. I always take a database snapshot before running a new automation for the first time.

When This Approach Makes Sense

Not every WordPress site owner needs custom automation. If you're running a personal blog with 20 posts, plugins and manual work are probably fine. But if you're in any of these situations, WordPress automation with Claude Code is worth exploring:

  • You manage multiple WordPress sites for clients and repeat the same admin tasks across them
  • You have a content-heavy site (500+ posts) and need to make structural changes or updates at scale
  • You're spending $300+ per year on premium plugins that mostly handle bulk editing or scheduling
  • You need custom workflows that don't fit into any existing plugin's feature set

For Vancouver clients I work with—especially real estate agencies, content publishers, and e-commerce stores—the automation ROI is usually immediate. A single bulk migration or scheduled update task can save 10+ hours of manual work.

Getting Started

If you want to try this for your own WordPress sites, here's where I'd start:

  1. Pick one repeating admin task you do manually every month
  2. Document the exact steps—what you're changing, what conditions need to be met, what the output should look like
  3. Decide whether you need direct database access or if the REST API will work
  4. Write a small test script that operates on 5–10 posts, verify the output, then scale it up

I've written about similar workflows in my posts on workflow automation for small businesses and building custom tools with Claude Code. The principles are the same—start small, test thoroughly, and only automate what you've done manually enough times to understand the edge cases.

If you're managing WordPress sites for clients and want to explore how automation could fit into your workflow, I'm happy to walk through it on a call. And if you have questions about whether this approach applies to your specific setup, the FAQ page covers most of the common scenarios.

The tools are here. The question is just which hours you want to give back to yourself first.

Frequently Asked

FAQ

Can Claude Code replace WordPress plugins for automation?

For many repetitive admin tasks—yes. Claude Code can automate bulk edits, scheduled content updates, category migrations, and metadata changes without installing a plugin. It won't replace plugins that add user-facing features (like forms or e-commerce), but for backend automation it's often faster and cleaner than stacking premium plugins that slow down your site.

Do I need developer access to my WordPress site to use Claude Code?

You need either SFTP/SSH access to the server or the ability to run PHP scripts via the WordPress REST API. Most hosting providers (SiteGround, WP Engine, Kinsta) give you SSH access in their dashboards. If you're on managed WordPress hosting with restricted access, you can still use the REST API approach, which works through authenticated HTTP requests.

How long does it take to automate a typical WordPress admin task with Claude Code?

Most single-task automations—like bulk-updating post categories or scheduling future content—take 1–2 hours to build and test. More complex workflows, like migrating content from an old site structure to a new one while preserving SEO metadata, might take 4–6 hours. Once built, the script runs in seconds or minutes depending on volume.

Work with me

Want this kind of result for your business?

Start with the AI Audit — $1,500. One focused engagement. The 3 highest-ROI opportunities in your business, ranked. A working proof-of-concept of the #1. Credited toward your build if we go forward.

Book the AI Audit → Read the FAQ
← All posts Book the AI Audit →