Opens in a new tab
Turquoise abstract wavy W logo on a black background
Turquoise abstract wavy W logo on a black background
White WP PowerSuite logo on a black background
White WP PowerSuite logo on a black background
[wpps_ai_summarize]
On This Page
Last updated: 01/09/2026

Disable REST API

Block anonymous access to WordPress core REST endpoints (users, settings, themes, and similar) while leaving logged-in staff and third-party plugin REST routes untouched.

Overview

Restrict access to the WordPress REST API when your website does not need to expose core REST endpoints publicly.

Disable REST API gives you two levels of protection. The recommended Disable Public Access Only mode blocks anonymous access to WordPress core REST routes while keeping REST functionality available to logged-in users and leaving third-party namespaces alone. For highly controlled environments, Disable Completely can block REST access for everyone.

The module also removes common REST API discovery links from the frontend, giving you more control over how WordPress exposes its REST interface without requiring custom code.

Disable REST API is a Free security module in WP PowerSuite.

Solid black square
Solid black square
Who is this for?
  • Site owners who do not need WordPress core REST data exposed publicly
  • Agencies hardening client websites while keeping normal editor functionality
  • Business websites that do not rely on anonymous core REST API access
  • Developers who want to restrict core REST without automatically blocking plugin APIs
  • Security-conscious administrators who need stronger REST controls for private environments

Features

Restrict Public REST API Access
The default mode blocks anonymous visitors from accessing WordPress core REST API routes while allowing authenticated users to continue using them.
Keep Third-Party APIs Available
Public mode focuses on WordPress core namespaces. REST endpoints belonging to WooCommerce, forms, membership tools, headless plugins, and other third-party integrations are left alone by default.
Completely Disable REST When Required
For more restricted environments, choose Disable Completely to block REST requests for both visitors and logged-in users.
Protect Core WordPress Namespaces
Restrict core endpoints including wp/v2, Site Health, Block Editor, oEmbed, WordPress abilities, and other current or future WordPress core REST namespaces.
Remove REST Discovery
Optionally remove REST discovery from the HTML , HTTP Link headers, oEmbed discovery, and the relevant RSD output.
Developer Route Controls
Filters allow developers to customize which namespaces are considered core, adjust anonymous access for individual routes, or explicitly allow selected routes when using complete-disable mode.

Restrict the WordPress REST API Without Automatically Breaking Everything

The WordPress REST API is an important part of modern WordPress. It allows applications to interact with site data through structured HTTP endpoints and is used by WordPress itself as well as many plugins, themes, mobile applications, and external integrations.
That means "disable the REST API" is not as simple as turning off an unused feature.
Completely blocking REST can affect the Block Editor, Site Editor, media workflows, applications, and plugin functionality. At the same time, some websites have no reason to expose WordPress's core REST data to anonymous visitors.
WP PowerSuite addresses this with two distinct modes instead of treating every website the same. For most security-hardening scenarios, Disable Public Access Only is the appropriate choice. It restricts anonymous access to WordPress core REST endpoints while keeping authenticated WordPress functionality available.
When a site has a genuine requirement to eliminate REST access altogether, the stronger Disable Completely mode remains available.

Block Anonymous Core REST Access While Keeping WordPress Usable

The default Disable Public Access Only mode is designed to provide a practical balance between REST API hardening and compatibility.
Anonymous visitors are prevented from accessing WordPress core REST namespaces such as wp/v2, Site Health, Block Editor, abilities, and oEmbed endpoints. Requests to the REST index and future routes following WordPress's core namespace conventions are covered as well.
Logged-in users continue to have full REST access.
This distinction matters because modern WordPress administration relies heavily on REST. An editor working inside the Block Editor may need REST requests to load, save, and interact with content. Preventing those requests for authenticated users would create unnecessary compatibility problems when the actual goal is simply to prevent anonymous visitors from querying core endpoints.
When a guest requests a protected core route, WP PowerSuite returns an authentication-required REST response rather than exposing the requested data.

Keep WooCommerce and Plugin REST APIs Separate

A common problem with aggressive REST-blocking snippets is that they treat every endpoint as if it belongs to WordPress core.
Many WordPress plugins depend on their own REST namespaces. WooCommerce, form builders, membership systems, payment integrations, frontend applications, and other plugins may expose endpoints required for normal site functionality.
In Disable Public Access Only mode, WP PowerSuite deliberately targets WordPress core namespaces rather than blindly shutting down the entire REST server.
Third-party namespaces remain available unless another security rule or the plugin itself restricts them.
This makes public-only mode significantly more practical for real WordPress websites where the core API may not need to be anonymous but plugin functionality still depends on REST.
It is still important to test important frontend functionality after changing REST access, particularly on sites with custom integrations.

Completely Disable the WordPress REST API When Necessary

Some environments have stricter requirements and may genuinely need REST disabled for everyone.
Disable Completely blocks REST access for anonymous visitors and authenticated users alike. Requests receive a 403 response unless a developer has explicitly allowed the route through the available filter.
This mode is intentionally accompanied by a confirmation because the compatibility impact can be substantial.
The WordPress Block Editor, Site Editor, media functionality, mobile applications, REST-based tools, and many plugins can depend on the REST API. Completely disabling it can therefore break functionality even for administrators.
For that reason, complete disable should be used when you understand the dependencies of the website and have a specific reason to block REST entirely. It should not be treated as a universally "more secure" setting that every WordPress installation should enable.

Reduce Public WordPress REST Discovery

Restricting access to REST routes addresses the requests themselves, but WordPress can also advertise its REST interface in several places.
With REST discovery removal enabled, WP PowerSuite removes the standard REST link from the frontend HTML and the related HTTP Link header. It also removes relevant oEmbed discovery links and the REST-related entry exposed through WordPress's RSD output.
These changes reduce passive discovery of WordPress REST endpoints while leaving the actual access policy controlled by the selected REST mode.
Discovery removal should be understood as cleanup and exposure reduction rather than the primary security control. A REST endpoint does not become secure merely because its discovery link is hidden. The important protection is the access restriction applied to the REST request itself.

Reduce Public WordPress User Enumeration

WordPress core REST endpoints can expose information about users in configurations where anonymous access is available.
Because Disable REST API's public mode already restricts WordPress core routes, it also covers the core user endpoints that related WP PowerSuite security modules would otherwise need to guard separately.
For example, Disable Author Archives can remove public author archives entirely, while Hide Author URLs can keep those archives but replace normal author slugs with randomized identifiers. Both modules include their own REST-related safeguards when used independently.
When Disable REST API is enabled, those modules recognize that core REST access is already being handled and avoid applying redundant user-endpoint restrictions.
This allows the modules to work together as separate layers: one controls the REST API, while the others control how WordPress exposes public author information.

Choose the Right REST Mode for Your Website

For most conventional WordPress websites looking to reduce unnecessary public API exposure, Disable Public Access Only is the sensible starting point.
It blocks anonymous access to core WordPress REST routes while keeping authenticated administration available and leaving third-party namespaces untouched by default.
Disable Completely is considerably more aggressive. It is better suited to controlled environments where you know the website does not depend on REST or where an explicit allow-list has been built for the routes that must remain available.
Whichever mode you choose, test the website afterward. Check content editing, media, forms, WooCommerce functionality, account areas, integrations, and any frontend features that may communicate through REST.
Security controls are most useful when they reduce unnecessary exposure without breaking functionality the website actually needs.

Use Cases

  • Restrict Anonymous WordPress REST Access
    Block public access to WordPress core REST endpoints while keeping them available to logged-in administrators and editors.
  • Reduce User Enumeration
    Restrict anonymous access to core REST user endpoints as part of a broader WordPress account-hardening strategy.
  • Harden Business Websites
    Reduce unnecessary public WordPress API exposure on sites that do not use anonymous core REST functionality.
  • Preserve WooCommerce & Plugin APIs
    Use public-only mode when core REST should be restricted but third-party namespaces still need to operate.
  • Lock Down Controlled Environments
    Use Disable Completely on specialized installations where REST is intentionally unavailable and compatibility has been reviewed.
  • Combine With Author Protection
    Use Disable Author Archives or Hide Author URLs alongside REST restrictions when you also want greater control over public WordPress author exposure.

Frequently Asked Questions

Related Modules

Removes WordPress version from public HTML generator tags, feed generator output, and the admin footer. Does not change ver= on script and...
Disabled
Two-factor login for selected roles—extra proof beyond the password.
Disabled
Automatically protects visible email addresses and mailto links from basic spam bots by safely encoding them while keeping them clickable for visitors.
Disabled
Blocks risky default usernames during registration so bots have fewer easy targets.
Disabled
Bot protection with Cloudflare Turnstile on logins, forms, comments, and WooCommerce—low hassle for real people.
Disabled
Disables WordPress application passwords site-wide: blocks REST/XML-RPC login with app tokens and hides the profile UI. Normal account passwords and logged-in REST...
Disabled
Google reCAPTCHA on logins, forms, comments, and WooCommerce to block bots and spam signups.
Disabled
Allow or block visitors by IP address—ideal for office-only dashboards or shutting out known troublemakers. Rules apply site-wide, including wp-admin and login.
Disabled
Stops old-style trackbacks and pingbacks that often bring spam or junk alerts.
Disabled
Put your whole site behind one shared password—ideal for staging, client previews, or a soft launch before you go public.
Disabled