Blog · Guides

User Roles and Least Privilege in WordPress

Every WordPress account you create is a door. If that door opens onto the whole house, a single stolen password becomes a full site takeover. Least privilege means giving each person only the access their job requires, nothing more, so a compromised editor account cannot install plugins and a compromised author account cannot touch other people’s posts. This is one of the cheapest security upgrades available: no plugin, no cost, just twenty minutes with your user list.

What Administrator Access Actually Grants

It is easy to default everyone to Administrator because it “just works.” But the Administrator role can install and delete plugins and themes, edit theme and plugin files directly from the dashboard, create and delete other users, and change core site settings. On a multisite network, Super Admin goes even further. If an account with this role is phished or reused from a leaked password list, the attacker inherits all of it instantly. Reserve Administrator for the one or two people who genuinely manage the technical side of the site.

Mapping People to WordPress’s Built-in Roles

WordPress ships with five core roles, and most sites never need anything beyond them:

  • Administrator: full control. Site owners, developers, and agency staff who maintain plugins and settings.
  • Editor: can publish and manage posts and pages belonging to any user, but cannot touch plugins, themes, or site settings. Good for a managing editor or content lead.
  • Author: can publish and manage their own posts only. Good for regular contributors who do not need editorial oversight of others’ work.
  • Contributor: can write and edit their own posts but cannot publish them; someone else has to approve and push live. Useful for guest writers or freelancers you have not fully vetted yet.
  • Subscriber: can log in and manage their own profile, nothing else. This is the correct role for anyone who just needs an account to comment, access gated content, or check an order history on a store.

If your site runs WooCommerce, membership plugins, or forums, you will also see custom roles those plugins add (shop manager, customer, and similar). Treat them with the same scrutiny: read what capabilities they actually grant before assigning them by habit.

A Simple Rule for New Accounts

When someone asks for access, start at the bottom of the ladder, not the top. Ask what they specifically need to do this week, assign the lowest role that covers it, and raise it later if it turns out to be too restrictive. It is much easier to grant one extra capability than to walk back a breach caused by over-granting.

Auditing Who Has Access Right Now

Most sites accumulate accounts nobody remembers creating: a freelancer from two years ago, a plugin’s demo user, a client’s former employee. Wp-cli makes an audit fast. From your site root:

wp user list --fields=ID,user_login,user_email,roles,user_registered

This prints every account with its role and registration date in one table. To narrow in on the accounts that matter most for risk, list just the administrators:

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

Go through that shorter list line by line and ask, for each one: is this a real person who still works on this site, and do they still need full access? If you cannot immediately answer yes to both, that account needs attention.

It also helps to check for accounts that have never logged in, which often indicates a forgotten setup account or a bot-created registration:

wp user meta list <user_id> --keys=last_login

Not every installation tracks last login by default, so if that field is empty across the board, it is worth adding a lightweight login-tracking approach or checking your host’s access logs instead.

Demoting and Removing Accounts

Once you have identified accounts that are over-privileged or simply stale, wp-cli handles both cases cleanly. To demote an account instead of deleting it (useful when someone is still a contributor to the site but no longer needs admin rights):

wp user set-role <user_id> editor

To remove an account entirely, you can either delete it outright or reassign its content to another user first, which is usually the safer option so authorship history is not lost:

wp user delete <user_id> --reassign=<new_owner_id>

Do this review on a schedule, not just once. A quarterly pass through your user list, alongside a look at active plugins and installed themes, catches drift before it becomes a liability. Offboarding a departing team member should always include an immediate account removal or role downgrade as a standard step, not an afterthought.

Least Privilege Works Alongside Other Hardening Steps

Role management is one layer, not the whole strategy. It pairs naturally with the other basics: strong unique passwords with two-factor authentication on every privileged account, limiting login attempts to slow down brute-force tools, disabling XML-RPC if you are not using it for anything like the mobile app or remote publishing, and setting DISALLOW_FILE_EDIT in wp-config.php so even a compromised Administrator session cannot edit theme or plugin files from the dashboard:

define('DISALLOW_FILE_EDIT', true);

Tested off-site backups remain your last line of defense if any of these layers fail. A good managed host, ServerBorn included, handles server-level protections like the WAF and DDoS mitigation for you, but account and role hygiene inside WordPress itself is squarely the site owner’s job. No hosting stack can guess which of your users still needs admin rights.

Takeaway

Least privilege is not about distrust, it is about limiting the blast radius when something inevitably goes wrong: a phished password, a reused credential, a forgotten freelancer account. Map every person to the lowest role that lets them do their job, audit your user list with wp-cli on a regular schedule, and remove or demote what you find. It costs nothing but attention, and it closes one of the most common paths attackers use once they get a single set of credentials.