On this page
What this issue is
User enumeration is when anyone can discover the usernames on your site without logging in. On WordPress this happens in two common ways. The REST API route /wp-json/wp/v2/users lists public authors with their slug. The old trick /?author=1 redirects to /author/<username>/, which exposes the author slug, and by default that slug is often the login name.
Why it costs you leads or sales
The direct cost is small. The risk is indirect: a known admin username makes brute-force and credential-stuffing attempts more efficient. A hijacked account can then change forms, redirect traffic, inject spam or take the site down, and that is when leads and sales are lost.
- Username leaked/wp-json/wp/v2/users or ?author=1 shows the login name
- Password guessingAttacker targets a known account
- Admin takeoverForms, redirects or scripts altered
- Leads and sales lostBroken forms, spam, blocklisting
The leak is the first step; the damage comes later if other defences are weak.
How to check if your site has it
Open the users REST routeWordPress
Visit https://yoursite.com/wp-json/wp/v2/users in a private window. A JSON list with "slug" values means usernames are exposed. A 401 or 403 error means it is restricted.
Try the author redirectWordPress
Visit https://yoursite.com/?author=1. If you land on /author/something/, the slug is public.
Compare slug and login nameWordPress
In Users, check whether the exposed slug equals the username you log in with. If it does, the leak is directly useful to an attacker.
Check from the command line
Run the curl commands below and read the response codes.
Check sitemaps and feedsWordPress
Open /wp-sitemap-users-1.xml and /author/ pages. Author sitemaps list author URLs.
curl -s -o /dev/null -w "%{http_code}\n" https://yoursite.com/wp-json/wp/v2/users
curl -s -I "https://yoursite.com/?author=1" | grep -i -E "^(HTTP|location)"How to fix it
Restrict the users REST route
Add the snippet below to a small custom plugin or your child theme's functions.php. It removes the users routes for visitors who are not logged in.
Stop the ?author= redirect
Use the second snippet to send ?author=N requests to the home page.
Separate login from public name
Under Users > Profile, set a Nickname and choose it under 'Display name publicly as'. If the login is also the slug, create a new admin with a different login and delete the old one.
Handle author archives and sitemaps
If you have one author, disable author archives with your SEO plugin (for example, Yoast SEO: Settings > Advanced > Author archives). This also removes them from the sitemap.
Block at the server
On nginx or Apache you can return 403 for ?author= requests. See the nginx snippet. Test it before deploying.
Require auth on user lists
If you built your own API, make any endpoint that lists users require authentication and return only public display fields.
Check what is exposed
Shopify has no public user list. Only review blog article author names, which are display names you choose under Online Store > Blog posts.
Review blog author profiles
Wix has no WordPress-style user API. Check that public member or blog author names are not the same as your account email or login.
add_filter( 'rest_endpoints', function( $endpoints ) {
if ( ! is_user_logged_in() ) {
unset( $endpoints['/wp/v2/users'] );
unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
}
return $endpoints;
} );add_action( 'template_redirect', function() {
if ( ! is_admin() && isset( $_GET['author'] ) ) {
wp_redirect( home_url( '/' ), 301 );
exit;
}
} );if ($args ~* "(^|&)author=\d+") {
return 403;
}How to confirm it's fixed
- /wp-json/wp/v2/users returns 401, 403 or 404 in a private window
- /?author=1 no longer redirects to /author/username/
- Author sitemap and archives are gone or show only a safe display name
- The public slug is not your login name
- Contact forms, checkout and search still work
Exposed
- /wp-json/wp/v2/users returns JSON with slugs
- ?author=1 redirects to /author/admin/
- Login name equals public slug
Hardened
- Users route returns 401 or 403 for visitors
- ?author= requests go to the home page
- Public name differs from login name
How to prevent it happening again
- Use a unique login name that is never shown publicly
- Turn on 2FA and rate limiting for admin accounts
- Keep WordPress core and plugins updated, since updates and new plugins can re-expose routes
- Re-run the two checks after changing themes, SEO plugins or security plugins
- Include this check in your regular security review
How FunnelGuard handles this
This issue is outside what FunnelGuard checks. FunnelGuard runs your customer journeys, such as lead forms and checkouts, and checks tracking and lead delivery. It does not test for exposed usernames or other web application security weaknesses.
The kind of tool that fits is a web vulnerability scanner or a WordPress security scanner, ideally paired with a web application firewall that can rate-limit logins. Run the scan on a schedule and after major changes.
Questions people ask
Why can people see my WordPress usernames at /wp-json/wp/v2/users?
WordPress exposes public authors through the REST API by default. The response includes each author's slug, which is often the same as the login name. You can restrict the route to logged-in users with the rest_endpoints filter.
How do I stop ?author=1 from revealing my username?
Redirect any request with an author query parameter to the home page, using a template_redirect hook or a server rule. Also change your public display name and make sure the author slug differs from your login.
Is user enumeration a serious vulnerability?
On its own it is usually rated low. It gives attackers a valid username, which makes password guessing easier. The risk grows if you have weak passwords, no 2FA or no login rate limiting.
Will disabling the users REST endpoint break my site?
It can, if a plugin or headless front end reads that route for logged-out visitors. The block editor still works because you are logged in. Test forms, search and any apps after making the change.
How do I change my WordPress author slug?
The slug is based on the user's login name. Create a new user with a different login, give it the admin role, then delete the old user and reassign its content. Also set a separate public display name in the profile.
How can I test if my site leaks usernames?
Open /wp-json/wp/v2/users and /?author=1 in a private window. If you see a JSON list or land on an /author/name/ page, usernames are exposed. A 401, 403 or 404 means that route is blocked.
Can FunnelGuard detect user enumeration?
No. This is outside what FunnelGuard checks. Use a web vulnerability scanner or a WordPress security scanner for it.
Related issues
- OPS-158Exposed admin login (/wp-admin, /administrator) without protectionFix guide
- OPS-159No 2FA on admin accountsFix guide
- OPS-160Default admin username / weak passwordsFix guide
- OPS-161Credential stuffing on loginFix guide
- OPS-168XML-RPC enabled and abusedFix guide
- OPS-155Outdated CMS core with known CVEsFix guide