What the WordPress REST API Reveals About a Site (and How to Limit It)
Updated 24 Oct 2026 路 by the DetectWP team
Since WordPress 4.7, every site has shipped with a REST API: a set of URLs under /wp-json/ that return the site's content as JSON. It powers the block editor, mobile apps and countless integrations, and it is switched on by default. Part of it is public, which means anyone can read it without logging in.
Most of what it shows is information the site already publishes on its pages, just in a tidier form. A few parts surprise site owners, the list of usernames in particular. This guide explains what an outsider can see, what stays private, and how to tighten the public parts without breaking the editor.
The index: a map of the site's software
Visiting https://example.com/wp-json/ returns the API index. It begins with the site's name, description and URL, then lists every namespace and every route registered on the site. Core WordPress registers wp/v2 and oembed/1.0; plugins register their own, such as yoast/v1, wc/store/v1 for WooCommerce or contact-form-7/v1.
That makes the index one of the best ways to see which plugins a site runs, including back-end plugins that load nothing on the front end. It is how DetectWP finds many of the plugins in a scan, and it is covered step by step in how to see which plugins a WordPress site uses. When pretty permalinks are off, the same index lives at ?rest_route=/.
Users: the part that surprises people
The route /wp-json/wp/v2/users lists, without any login, every user who has published at least one public post. Each entry includes the user ID, display name, the slug used in author URLs and links to their avatar. The slug is very often the same as the login username.
Email addresses, roles and passwords are not included, and users who have never published anything are not listed. A separate route, the author archive at /?author=1, redirects to /author/slug/ and reveals the same slugs one ID at a time. Usernames on their own do not let anyone in, but they give automated login attacks half of what they are guessing, which is why it is worth limiting this route on most sites.
Content, media and everything else that is public
The wp/v2 routes for posts, pages, categories, tags, comments and media return the same published content that visitors can already browse, with extra detail: publication and modification dates, author IDs, featured image URLs, and for media, the original file and every generated size. Custom post types appear too when their developer made them available to the API.
None of this is a leak in itself, since it is published content. It is, however, very convenient for anyone who wants to copy a site's content in bulk, and the modification dates and media details can tell a competitor more about your publishing habits than your pages do. The earliest post date is also one of the clues in how to find out how old a website is.
What stays private
The public API follows the same permissions as the website. Without a login, it does not return drafts, private or password-protected posts, unpublished revisions, user email addresses, roles, settings, or anything from plugins that require authentication. WooCommerce's order and customer routes, for example, appear in the index but refuse requests that are not signed in by a store manager.
Writing is also protected. Creating, editing or deleting content through the API requires an authenticated user with the right capabilities, using a login cookie with a nonce or an application password. Problems arise when a plugin registers its own route without a proper permission check, which is a common class of plugin vulnerability. Keeping plugins updated, as described in how to check a site for vulnerable plugins, is the defence there.
How to limit what the API exposes
Do not disable the REST API entirely. The block editor, the site editor, many plugins and the WordPress mobile apps depend on it, and blocking it outright breaks them. Limit the public parts instead. The most useful step is hiding the users routes from visitors who are not logged in, which you can do with a few lines in a small custom plugin or a snippets plugin such as Code Snippets:
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;
} );Many security plugins offer the same thing as a setting, often alongside an option to stop author-archive enumeration. Beyond that, give authors a display name and nickname that differ from their login username, and protect logins with strong passwords and two-factor authentication, which makes knowing a username worthless. Our guide to hiding WordPress fingerprints covers the plugin namespaces in the index.
Frequently asked questions
Is it a security risk that /wp-json/ is public?
Mostly no. It exposes content that is already published, and it follows WordPress permissions. The main concern is the users route revealing author usernames, which is easy to restrict.
Should I disable the WordPress REST API?
No. The block editor and many plugins rely on it. Restrict specific public routes, such as users, for logged-out visitors instead of turning the whole API off.
Does the REST API show email addresses?
Not to visitors who are not logged in. The public users route shows the display name, slug, ID and avatar of users with published posts, but never their email address or role.
How do I find which plugins a site uses with the REST API?
Open /wp-json/ on the site and read the namespaces list. Most plugins that add API routes register a namespace named after themselves, such as yoast/v1 or wc/store/v1.
Related
Free tools: WordPress plugin detector 路 WordPress theme detector 路 WordPress hosting detector