Automating WordPress Setup with WP-CLI and AI: Why You Should Too

Marcel Tannich speaking live on stage at WordCamp Europe 2025 in Basel.

How I Discovered WP-CLI and Started Automating WordPress

In the summer of 2019, a single webinar changed the way I work with WordPress forever. I joined a SiteGround session where Alain Schlesser introduced something I had never seen before: WP-CLI. Within minutes, I was hooked.

Installing WordPress, activating plugins, configuring themes — all from the terminal, no dashboard clicks. It felt like unlocking a hidden level in a game I thought I already knew.

A few weeks later, I shared it with my team. Soon after, I was presenting it internally. By early 2020, I was on stage at WordCamp Vienna, showing developers how to spin up a complete WordPress project in seconds with WP-CLI and scripts.

WordPress launched. Plugins running. Options locked… all in seconds.

That experience opened my eyes: I had been doing it all wrong. And I wasn’t alone.

By the time I led a WP-CLI workshop at WordCamp Europe 2021, I realized many developers were still setting up everything manually. That’s when it clicked:

Automation isn’t just for DevOps. It’s for everyone building with WordPress.

Marcel Tannich on stage at WCEU 2025 in Basel with the audience in the background.
Photo Credit: Marc Wieland

Why Manual WordPress Setup Wastes Time

If you’ve ever set up a WordPress site from scratch, you know the drill:

  1. Install WordPress manually or through a hosting panel.
  2. Configure wp-config.php.
  3. Adjust permalinks, add users, tweak SEO, caching, and security settings.
  4. Install and configure your go-to plugins and theme.

The first time, it’s fine. Maybe even the second. But by the tenth? It’s mind-numbing.

And here’s the real problem: it’s inconsistent and error-prone, especially when you’re juggling multiple projects.

Worst of all? It’s a complete waste of your time.

That’s when I started asking myself:

“Why am I doing something a machine could do?”

How WP-CLI and Bash Scripts Changed My Workflow

At first, WP-CLI felt like a magic trick. With just one command, WordPress was up and running.

But I wanted more.

So I began creating simple Bash scripts to automate everything I needed:

  • Installing plugins
  • Adding my starter theme
  • Setting permalinks
  • Applying SEO, caching, and security defaults

Suddenly, the process was fast, consistent, and repeatable.

Here’s what that looked like in action:

This screenshot shows a basic bash script including WP-CLI commands.

If WP-CLI is new to you, don’t worry. I’ll share starter resources at the end of this post.

Imagine this: one script installs WordPress, another fine-tunes your settings, then it fires up your custom stack — and you’re done.

Just like that. Done. Before you even finish your coffee. 😉

Making Automation Accessible: The WP-CLI Script Generator

After a while, I started sharing my scripts, and people loved them.

But there was one problem: not everyone felt comfortable using WP-CLI or writing Bash scripts.

So I asked myself: How can I make this easier for people who don’t use the terminal?

That’s when I built a web-based WP-CLI script generator powered by AI. No coding, no CLI. Just a simple, visual tool.

You tick a few checkboxes for what you need:

  • WooCommerce
  • Yoast SEO
  • Your favorite theme
  • Permalinks
  • Security & caching tweaks

In one click, you get a tailored Bash script, ready to run.

No terminal expertise needed. No coding. No fear.
Just copy, paste, go.

From Scripts to AI-Powered Tools

We started with manual scripts — every command hand-typed. Then WP-CLI came along and sped everything up.

Now, we’ve entered the era of AI-powered tools like Vercel V0, Replit, and Loveable.

They don’t generate WordPress setups directly — but they enable us to build automation tools and scripts faster than ever before.

That means:

  • Turning ideas into prototypes in minutes, not hours
  • Building reusable tools for every project
  • Freeing up time for strategy, not repetitive tasks

And once these tools exist, they’re not one-offs. They’re adaptable and reusable for future projects.

If AI can accelerate setup generation this much… what else could it do?

Demo: AI-Assisted WordPress Automation in Action

Curious what this looks like in practice?

In the video, you’ll see how I:

  • Use AI to generate setup commands
  • Streamline WP-CLI workflows
  • Configure plugins and themes — all from a single generator interface

The best part? The entire tool was built with prompts.

No IDE. No manual coding. Just prompting, testing, and running.

It’s a working proof-of-concept that shows where WordPress automation is already headed.

The Future: MCP, AI Agents, and Self-Healing WordPress

Today, we can spin up WordPress stacks in minutes with WP-CLI. Tomorrow, we’ll do even more.

At CloudFest, Pascal Birchler and his team wired MCP (Model Context Protocol) into WP-CLI. That means you can run commands like:

Copied!
$ wp ai "create 10 test posts about Swiss recipes with generated featured images"

…and get fully populated content instantly.

🆕 Update — September 2025: Since I first presented this talk, Automattic has published an MCP integration for WordPress (GitHub repo) and also formed a dedicated AI team.

So what’s next? We might soon see:

  • MCP playbooks → structured YAML/JSON bundles of WP-CLI, Bash, and Composer commands (think Docker Compose, but for WordPress)
  • AI agents → assistants that can set up multilingual WooCommerce stores, import products, and configure stacks automatically
  • Self-healing workflows → AI that detects plugin errors, tests fixes in a sandbox, and pushes patches back to your repo for human approval

With scripts stored in Git, consistent stacks, and automation extending to SEO, caching, and security — setup will no longer be the bottleneck.

Stop Doing It Manually: Automate Your Setup

Automation isn’t laziness. It’s focus.

“Automation isn’t about being lazy. It’s about eliminating distractions, so you can focus on what truly matters.” — Marcel Tannich

Here’s my challenge to you: Never set up WordPress manually again.

The best developers don’t waste time on repetitive tasks. They automate them.

Next time you’re about to create a new site, ask yourself: “Is this something a machine can do?”

If the answer is yes… let it. AI is here to assist, not replace. It helps you automate the setup, so you can focus on strategy, not scripts.

And that’s the real takeaway:

Build more. Learn more. Rest more.
You’ve got better things to do — so go do them.


Resources

Ready to try it yourself?
Download the scripts and the AI setup generator on GitHub
Read my introduction to WP-CLI


Share Your Workflow

How are you automating WordPress today?
Drop a comment — I’d love to hear your approach.

Frequently Asked Questions

What is WP-CLI?
WP-CLI is the official command-line interface for WordPress. It lets you install, configure, and manage sites directly from the terminal without using the dashboard.

Do I need to know Bash to automate WordPress?
Not necessarily. WP-CLI commands work on their own, and simple Bash scripts just combine them. You can also use generators and AI tools to skip manual scripting.

What is MCP in WordPress?
MCP (Model Context Protocol) connects AI models with tools like WP-CLI. It enables advanced automation, such as generating content or configuring sites with a single command.

Photo Credit

Title Photo: Roberto Vázquez

Leave a Reply

Your email address will not be published. Required fields are marked *