← All insights

How I keep a fleet of client WordPress sites updated without breaking them

At the agency where I lead web delivery, we look after a lot of client websites, mostly WordPress, mostly on SiteGround. For a long time, “maintenance” meant logging into each site one by one, clicking Update, and hoping nothing broke. With dozens of sites, that doesn’t scale, and it’s exactly how a plugin update quietly takes a client’s contact form offline on a Friday afternoon.

So I built a small internal dashboard to do it properly. This post explains how it works, the rules it follows, and three real problems I had to diagnose while building it. I’ve kept client names, server details and anything sensitive out.

The goal

One screen that answers, for every site:

  • Is it up, and how fast is it responding?
  • Is the SSL certificate valid, and when does it expire?
  • Which plugins, themes and WordPress core updates are waiting?
  • Are any of the installed plugins known to have security holes?
  • What changed, when, and was it safe?

And one button to update a site without gambling with it.

Why it connects the way it does

The obvious way to manage WordPress remotely is a companion plugin or an admin password stored somewhere. I didn’t want either: a plugin is one more thing installed on every site that could break or be attacked, and stored admin passwords are a liability.

Instead, the dashboard connects to each site the way a developer would: over SSH with a key, running WP-CLI, WordPress’s official command-line tool. In practice:

  • Nothing is installed inside WordPress, and nothing new is exposed to the internet.
  • No WordPress admin password is stored anywhere.
  • The private key never leaves my machine.
  • The dashboard can only run a short list of fixed, pre-written commands. Every plugin name, version and path it passes in is checked against strict rules first, so it can’t be tricked into running something else.

One honest limitation: SiteGround doesn’t offer a public API for backups, SSL renewal or DNS. The dashboard doesn’t pretend otherwise. It monitors those things from the outside and says plainly what it can and can’t do.

The safe-update routine

Every update follows the same steps, in the same order:

  1. Preview. Show exactly what will change: which plugins, from which version to which.
  2. Confirm. Nothing runs until a person says go.
  3. Back up the database first. A compressed snapshot is saved on the server before anything is touched, keeping the last five.
  4. Update.
  5. Health check. Load the site again, check it still responds properly, and verify WordPress’s core files.
  6. Roll back automatically if the health check fails, by reinstalling the previous version of the plugin that broke it.
  7. Log everything. What ran, what changed, and whether it was rolled back.

Rollback has a limit, and I wrote it down rather than hide it: automatic rollback works for free plugins from WordPress.org. For premium plugins and themes, the dashboard stops, reports the problem and points to the snapshot, because it can’t download an old copy of a paid plugin by itself.

Problem 1: the update script that silently stopped halfway

Early on, maintenance runs finished “successfully” but did only part of the work. The first step ran, and everything after it was simply missing. No error.

The cause turned out to be subtle. The dashboard sends its script to the server in one piece and has the server read it line by line. The first WP-CLI command in the script also reads input, so it quietly swallowed the rest of the script as if it were meant for itself. The server then had nothing left to run, and exited happily.

The fix was one small change: tell every WP-CLI command to read from an empty input instead of from the script. I added a test that runs the full script against a simulated server, so this can’t come back without the tests failing.

Lesson: “finished without errors” is not the same as “did the work”. The dashboard now confirms each step’s result instead of trusting the exit code.

Problem 2: fixing a site that wasn’t the live site

This was the important one. For a few sites, the dashboard reported “patched and healthy”, yet the live website was clearly still running old versions.

To find out why, I placed a harmless marker file on each server copy and checked whether the public website actually served it. For four domains it didn’t: the live site was running on a different host entirely (another managed WordPress host, or another server behind the CDN), and the SiteGround copy we were maintaining was an old leftover. Every update had been going to a site nobody visited.

What I changed:

  • The dashboard now runs this “is this the live copy?” check every day.
  • If a site fails it, the dashboard stops auto-patching it, raises a clear issue (“Live site is on another host”), and won’t mark related problems as solved until a person looks.
  • The affected follow-up tasks were reopened with an explanation, so nobody assumed those sites were safe.

Lesson: always verify you’re changing the thing the public actually sees, especially after hosting moves.

Problem 3: uptime checks failing on a working site

Some perfectly healthy sites kept showing as offline. The sites were fine in a browser.

The dashboard’s lookup of each domain’s address was going through a local network setting that answered with the wrong address. The fix was to have the monitor ask well-known public DNS servers directly, so the check sees what a visitor on the internet sees.

Security, not just updates

Updates are half the job. The other half is knowing what’s dangerous right now:

  • The dashboard checks every installed plugin and theme against a public vulnerability database and patches vulnerable free plugins automatically, using the same safe routine as above.
  • It flags new administrator accounts, WordPress files that don’t match the official versions, spam showing up on a homepage, DNS changes and domains about to expire.
  • Premium themes and plugins can’t always be updated from the command line without their license. For one premium theme I found how its updater stores licensed updates and made it work from the command line, with a backup of the theme folder taken first and restored automatically if the update fails.
  • One site was still on PHP 7.4, which no longer gets security fixes. Before switching, I tested the site against PHP 8.3 from the command line, then upgraded it, which also allowed a pending form-plugin update that needed the newer PHP.

Problems open a follow-up task automatically. Tasks for issues the dashboard can verify (a vulnerable plugin, an SSL problem) close themselves once the problem is actually gone. Anything that needs a human (a new admin account, changed files, an outage) stays open for a person.

How it’s built (briefly)

  • Node.js with its built-in SQLite database, and no outside packages to keep patched.
  • A simple web interface that only listens on my own machine.
  • An automated test suite that runs the real update and rollback logic against a simulated SSH and WP-CLI server, so changes are tested before they go near a client site.
  • I build with AI coding tools (Claude Code), and nothing it writes ships until I’ve read it and the tests pass.

What I’d tell anyone running a WordPress fleet

  1. Back up before every change, not on a schedule you hope lines up.
  2. Check the site after the change, automatically, and be ready to undo it.
  3. Write down what your tools can’t do, so nobody assumes a safety net that isn’t there.
  4. Verify you’re working on the live site.
  5. Treat “no errors” as a question, not an answer.