One WordPress setting, if it is set wrongly, lets anyone in the world create an administrator account on your site. It sits in Settings → General, takes thirty seconds to check, and attackers actively look for it.
The two settings that matter
In the WordPress dashboard, go to Settings → General and look at the Membership and New User Default Role lines.
- Membership: “Anyone can register.” When this is ticked, anyone can create an account on your site from the login page.
- New User Default Role. This is the role every new account gets.
On their own, both are harmless. A blog with comments might allow registration with the role Subscriber, which can’t change anything.
The danger is the combination: registration open and the default role set to Administrator. Then anyone who visits /wp-login.php?action=register becomes an administrator of your site with full control. Attackers who get into a site briefly, or exploit a plugin flaw that can change settings, set exactly this combination so they can come back whenever they like.

What the settings should be
| Your site | Membership | New User Default Role |
|---|---|---|
| A normal business, school or portfolio site | Unticked | Subscriber |
| A site where visitors need accounts (forum, membership, courses) | Ticked | Subscriber, or the role your membership plugin needs |
| A WooCommerce shop | Can stay unticked. WooCommerce has its own customer sign-up setting. | Subscriber (WooCommerce gives shoppers the Customer role) |
The default role should almost never be Administrator, Editor or Shop Manager. If you see one of those and you didn’t set it, treat the site as compromised.
Fix it
- Untick Anyone can register unless your site really needs it.
- Set New User Default Role to Subscriber.
- Click Save Changes.
Check it with WP-CLI
On many sites, or a hacked site where you would rather not log in to the dashboard, WP-CLI is quicker. (See my guide on opening the Terminal in cPanel and running WP-CLI.)
cd ~/public_html
wp option get users_can_register --skip-plugins --skip-themes
wp option get default_role --skip-plugins --skip-themes
users_can_register shows 0 for closed or 1 for open. default_role should say subscriber.
To fix both:
wp option update users_can_register 0 --skip-plugins --skip-themes
wp option update default_role subscriber --skip-plugins --skip-themes
Then check who already registered
If the setting was wrong, someone may already have used it. List the newest accounts first:
wp user list --orderby=registered --order=DESC --fields=ID,user_login,user_email,user_registered,roles --skip-plugins --skip-themes
In the dashboard, the same check is Users → All Users: click the Administrator filter at the top to see only administrators.
Warning signs:
- An administrator you don’t know, or one created recently
- A random-looking name, like
pepufpaporxkqwbtza - Names pretending to be official, like
host_support,wpadminorsupport_team - An email address that has nothing to do with your organisation
Don’t just delete a suspicious administrator straight away. First note its name, email and registration date, because that date tells you when the attacker was there. Then remove its administrator role and end its sessions. In Part 10 of my security series I show how I found fake administrators across a whole server and removed them safely.
Make it a habit
I add these two settings to my monthly check on every site. It is the cheapest security check there is, and it catches one of the most common ways attackers keep a door open.
