Insights

Patched to WordPress 7.1.4 but Rogue Admins Keep Appearing? Check for Backdoors

December 4, 2026
0:00
You updated WordPress to 7.1.4, deleted the administrator account nobody recognized, and a day later another one appeared. Sometimes it has the same username, sometimes a new one. The update worked. It closed the unauthenticated remote code execution (RCE) hole that affects Core 4.7 through 7.1.3. But an update only replaces core files. It does not remove code an attacker planted while the site was still vulnerable, and that code is usually what keeps recreating the account. If you want background on the advisory itself, CSO Online's write-up of the critical WordPress patch covers the fix and the recommendation to reset admin, database, and FTP/SSH credentials. This article starts after the patch, with the account that keeps coming back.
Rule out the simple explanation first. Sites often run several installs, a staging copy, or an old directory that still answers on a subdomain. Make sure the install you are looking at is the one serving traffic, and that it really is on the patched version.
BASH
wp core version
wp core verify-checksums
wp user list --role=administrator --fields=ID,user_login,user_email,user_registered
wp core verify-checksums compares core files against the official checksums from wordpress.org and reports files that were changed. It does not look inside wp-content. A clean result here tells you core is intact. It says nothing about plugins, themes, or uploads. Treat the user_registered column with suspicion. An attacker who can write to the database can set any date, so a rogue admin can look like it was created years ago. WP-CLI also has a limitation here. It boots WordPress to run most commands, which means it loads the site's code, including whatever the attacker added. Code can hook into user queries and hide accounts from both the Users screen and wp user list. Adding --skip-plugins --skip-themes reduces how much code runs, but must-use plugins (covered below) still load. If you suspect hidden accounts, query the database directly for anyone holding the administrator capability:
BASH
wp db prefix
wp db query "SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE meta_key LIKE '%capabilities' AND meta_value LIKE '%administrator%'" --skip-plugins --skip-themes
Replace wp_ with your actual prefix. If this query returns more user IDs than the admin list in the dashboard, something is filtering the list. That alone confirms code-level persistence.
Some rogue admins have no malicious code behind them, and these cases are quick to check. The first is the registration setting. Look at wp option get users_can_register and wp option get default_role. If registration is open and the default role is administrator, anyone can sign up as an admin through the normal registration form. An attacker who had access once can flip these two options and walk away with no files left behind. When this is the cause, the access logs usually show requests to wp-login.php?action=register shortly before each new account appears. The second is a database that keeps getting overwritten. A staging sync, a migration plugin, or a scheduled restore from a backup taken before the cleanup will put the deleted account straight back. If new admins appear at the same time a sync or restore job runs, start there. The third is another person with admin access. A developer or agency account whose password leaked can create users as easily as an attacker can. Brute force against wp-login.php or xmlrpc.php does not create accounts by itself. If it succeeds against an existing admin, though, that admin can create more. Check whether each legitimate admin recognizes their own recent logins. If none of these fit, assume the account is being recreated by code.
An account cannot recreate itself. Something has to execute wp_insert_user(), wp_create_user(), or a direct SQL insert, either on every page load or on a schedule. That narrows the search to a few places.
BASH
ls -la wp-content/mu-plugins/
wp cron event list --fields=hook,next_run_relative,recurrence --skip-plugins --skip-themes
crontab -l
Must-use plugins (mu-plugins) are PHP files in wp-content/mu-plugins/ that WordPress loads on every request, before regular plugins. They cannot be deactivated from the dashboard and only appear under a separate "Must-Use" tab, which many people never open. This makes them a popular spot for persistence. Many sites have this directory empty or missing. If yours has files, find out which host tool, caching layer, or developer put each one there. If nobody can account for a file, read it. WP-Cron events are the second place to check. A scheduled hook is only a name stored in the database. It does nothing unless some code registers a callback for it. So an unfamiliar hook in wp cron event list tells you two things: something scheduled it, and code somewhere is waiting to run when it fires. Look for hook names that match no installed plugin, or that imitate core naming with small differences. The server crontab comes next. A line that runs curl or wget against a PHP file inside the site, or one that downloads and runs a script, can rewrite files or recreate users from outside WordPress entirely. On control panels, the crontab for the hosting account is usually visible both in the panel's cron screen and through crontab -l as that user. Modified theme and plugin files are the last place, and the most common. The usual target is the active theme's functions.php, along with webshells dropped in wp-content/uploads/. That directory should normally contain no PHP files at all.
BASH
find wp-content/uploads -name '*.php' -ls
find wp-content -name '*.php' -mtime -30 -ls
grep -rnE 'wp_create_user|wp_insert_user|set_role|eval\(|base64_decode|gzinflate' wp-content --include='*.php'
wp plugin verify-checksums --all
The grep will return false positives, because legitimate plugins create users and some decode base64 for valid reasons. What you are looking for is user-creation code inside a theme, in an image folder, or in a file whose name imitates a core file. The 30-day window in the find command is only an illustrative example. Adjust it to the period when the site was exposed, and keep in mind that modification times are easy to fake. For plugins outside wordpress.org and for themes, download a clean copy of the same version and diff it against what is on disk. If you already reinstalled core and expected that to fix things, this is the gap. Reinstalling core leaves wp-content untouched, and wp-content is where most of this lives.
The order matters more than any single step. If you delete the rogue user first, the backdoor recreates it on the next request or cron run. If you rotate the database password while a webshell is still on disk, the attacker can read the new password from wp-config.php. Remove access in this sequence:
  1. Take a copy before changing anything. Run wp db export and archive the files. You need this as evidence and as a rollback point. Restrict access to the site during cleanup if you can.
  2. Remove the code persistence. Delete unexplained mu-plugins, PHP files in uploads, and injected code in themes. Replace wordpress.org plugins with fresh copies. Remove plugins nobody installed. Delete malicious entries from the server crontab.
  3. Clear the rogue scheduled events. Use wp cron event delete <hook> for each hook you identified. Their callbacks are gone after step 2, but stale events clutter the next review.
  4. Fix the registration settings. Set users_can_register back to 0 and default_role to subscriber, unless you genuinely need open registration.
  5. Delete the rogue users. Use wp user delete <id> --reassign=<legit-admin-id> so any content they own moves to a real account. This cannot be undone. Double-check every ID against the database query from earlier before you run it.
  6. Rotate every credential. Change all admin passwords, the database password in wp-config.php (and in the database server itself), and the FTP, SSH, and control panel passwords. Then regenerate the authentication salts with wp config shuffle-salts. New salts invalidate every existing login cookie, including any session the attacker still holds.
A quiet day after cleanup does not prove much. Cron-based persistence may be scheduled weekly, and some backdoors wait for a specific request from the attacker. For the next couple of weeks, re-run the database admin query and the mu-plugins listing regularly, and repeat the uploads find. The access logs show how the attacker got in and whether they are still trying. Patchstack's write-up on post-patch probing recommends reviewing server and WAF logs for suspicious POST requests and path-traversal strings from just before you applied the patch. If you then see POST requests to PHP files that should not exist, searching POST requests to upload endpoints shows how to trace where a webshell came from. If an admin reappears even after all of this, look beyond the single site. On hosting accounts with several WordPress installs running as the same system user, one infected install can write into all the others. Support engineers usually ask about other sites on the account early, because owners tend to clean only the site that showed symptoms. The patch closes the door the attacker used to get in. Deleting the account only removes what you can see. The fix that holds is to find the code that recreates access, remove it, and only then delete the users and rotate credentials. If you do it in a different order, you will likely be deleting the same account again next week.

Join My Newsletter & Get Updates!

Get notified whenever a new technical guide, server infrastructure breakdown, or personal reflection goes live, plus a curated weekly digest.