Security

Unknown Admin User in WordPress? What to Check Before You Delete It

A new administrator you don't recognize is either a forgotten teammate or a sign someone got in. Here is how to tell which, and what to do in what order.

Quick Answer: An administrator account you can't account for is not automatically proof of a hack, but treat it as one until you've ruled out the ordinary explanations: a developer, an agency, your host, or a tool you installed. Don't delete it yet. First write down its username, email address and creation date (on the command line, wp user list --role=administrator --fields=ID,user_login,user_email,user_registered shows all four). Then ask who might have created it. If nobody claims it, take a backup of the files and database, change every password tied to the site, sign all users out, check what the account touched, remove it, and find out how it was created. Deleting the user without finding the way in only removes the symptom.

Seeing an Admin Account You Don't Recognize?

Tell us what you're seeing and we'll help you work out whether it's a problem and contain it, or take site security off your plate entirely going forward.

Why an unknown administrator matters

An administrator account can install plugins and themes and edit their code from the dashboard. WordPress's own hardening guide describes the built-in file editor as often the first tool an attacker uses after logging in, because it allows code execution, and provides a setting, DISALLOW_FILE_EDIT, to switch it off. So an unexplained administrator is not a cosmetic problem. If it was created by someone who shouldn't have access, they may already be able to run code on your server.

There are three broad explanations, and only one of them is harmless: someone you authorized created it and nobody remembers, your registration settings let a stranger create it, or someone with access created it for themselves. The steps below separate them without destroying evidence.

Step 1: Write down what you see before you change anything

The WordPress incident guide starts with documentation, and that applies here. Note the username, display name and email address, the role, and when the account was created. Also note the time you noticed it (with time zone) and anything that changed recently: a new plugin, a developer's visit, a host migration.

In the dashboard, go to Users, All Users and filter by Administrator. If you have command-line access, WP-CLI lists administrators with their creation dates:

wp user list --role=administrator --fields=ID,user_login,user_email,user_registered --format=table

Without command-line access, the creation date is the user_registered column in the users table of your database (the table name starts with your database prefix, wp_ by default), which you can view in phpMyAdmin if your host provides it. Check the inbox behind Settings, General, Administration Email Address as well; that address may receive notices about user registrations around the creation time.

Step 2: Rule out the ordinary explanations

Ask the people who could plausibly have created it: current and former developers, agencies, freelancers, and anyone who administers the site for you. Compare the email domain against the people and companies you work with. Don't treat a professional-looking username as reassurance; a name that looks like a vendor or support account proves nothing either way.

Ask your host whether it creates service or support accounts on WordPress sites and, if so, which ones. Some platforms and tools do add accounts of their own, so confirm in writing rather than assuming. If someone does claim the account, confirm they still need administrator access, and if they don't, give them a lower role.

Step 3: If nobody claims it, treat it as an incident

Work through these in order:

  1. Take a backup of the files and the database before you change anything. WordPress's incident guide recommends a snapshot even if the site may be infected, because it gives you something to examine later.
  2. Change passwords everywhere it matters: every real administrator, the hosting account, the database user and SFTP. Do it from a computer you trust.
  3. Sign everyone out. After a suspected compromise, the incident guide suggests replacing the security keys and salts in wp-config.php, which ends every active login. wp config shuffle-salts does this from the command line. To end sessions for one account only, wp user session destroy <user> --all does that. Note that everyone, including you, will need to log in again, and that WordPress's hardening guide links to a technical article that argues against rotating salts routinely. Treat this as an incident step, not a maintenance habit.
  4. If you can't log in, the incident guide describes resetting a password through the login screen, or updating the account's email address in the users table through phpMyAdmin and then requesting a reset email.

Step 4: Check what that account could have touched

  • Other accounts. Look for any other user you don't recognize, and for existing accounts whose email address has changed.
  • Application Passwords. In each administrator's profile (Users, Profile), the Application Passwords section lists credentials for programmatic access, with last-used time and IP address, and each can be revoked individually. They don't work for normal browser logins, but they do work for the REST API, so revoke any you don't recognize. With WP-CLI: wp user application-password list <user> --fields=uuid,name,created,last_used,last_ip.
  • Plugins and themes. Anything installed that nobody on your side installed is a red flag.
  • Files. wp core verify-checksums compares WordPress core files with the official checksums, and wp plugin verify-checksums --all does the same for plugins. Both compare against WordPress.org, so plugins and themes from other sources generally can't be checked this way, and a clean result does not prove there is no backdoor in wp-content. The incident guide also lists files attackers commonly alter: .htaccess, index.php, header.php, footer.php and functions.php.
  • Logs. Your host's access logs around the account's creation time can show the IP address and what was requested. As WordPress's hardening guide points out, logs won't show the username that logged in, but they do show time, IP and actions.

Step 5: Remove the account without losing evidence or content

Once you have the backup and have recorded the account's details, remove it. WP-CLI makes the content decision explicit: wp user delete <user> --reassign=<user-id> moves the account's posts to another user. The dashboard asks a similar question about what to do with the account's content when you delete a user.

If the account authored any posts or pages, read them first. Reassigning content you haven't reviewed can keep injected links or scripts on the site. On a multisite network, wp user delete removes the user from the current site only; adding --network removes the user from the database, and the documentation advises reassigning posts before doing that.

Step 6: Find out how it got there

The account is the symptom. Likely routes include:

  • A vulnerable or outdated plugin, theme or WordPress core. WordPress's hardening guide identifies outdated software as one of the two most common attack paths. Update everything, and remove plugins and themes you don't use.
  • Stolen or guessed administrator credentials. The other common path is brute-force password guessing. Strong, unique passwords and two-step authentication for administrators reduce this.
  • Open registration with the wrong default role. Check Settings, General. If "Anyone can register" is ticked and "New User Default Role" is set to anything powerful, a stranger could create an account with that role. Unless you run a membership site, switch registration off; if you need it, the default role should be the lowest one that works.

Until you can name the route, treat the cleanup as unfinished. Once the site is clean, change the passwords again, because the first reset happened while access may still have been open.

Keeping it from happening again

Keep the number of administrators small; most people who edit content need Editor, not Administrator. Add two-step authentication for the accounts that remain. Set DISALLOW_FILE_EDIT in wp-config.php so a stolen login can't edit code from the dashboard. Review your administrator list on a schedule, and consider an activity-logging plugin or monitoring so a new administrator produces an alert instead of a surprise.

Sources

Related Troubleshooting Guides

Martin Van Den Boogerd
Martin Van Den Boogerd
Founder & Owner, CriticalWP, a WebOps agency for WordPress — background in cybersecurity and municipal government infrastructure
More about Martin →

Common Questions

No. A developer, an agency or your host may have created it, and people forget. But an administrator has full control of the site, so handle an unexplained one as an incident until you know where it came from.
You can, but back up first and record its username, email and creation date. Deleting it doesn't show you how it was created, and the same route can create another one.
On the command line, wp user list with the user_registered field shows it. Otherwise it is the user_registered column of the users table in your database.
Not on its own. Other accounts, Application Passwords, active login sessions and malicious files can all survive a password change, which is why the steps above also sign users out, review other accounts and credentials, and look for how the account was created.
Use the password reset on the login screen. If the reset email never arrives, your host can help you update the account's email address in the database, as WordPress's incident guide describes.

Not sure whether it's safe to remove?

CriticalWP handles containment, cleanup and hardening for compromised WordPress sites, and our Managed WordPress plan includes security hardening and monitoring.