by Jeff Starr
4.8 (36 reviews)
Disable WP REST API
Disables the WP REST API for visitors not logged into WordPress.
Compatible with WP 7.0
v2.6.7
Current Version v2.6.7
Updated 6 days ago
Last Update on 28 Mar, 2026
Refreshed 6 hours ago
Last Refreshed on
Rank
#1,115
+1 this week
Active Installs
30K+
—
No change
KW Avg Position
105.8
-0.2 better
Downloads
368.4K
+150 today
Support Resolved
0%
—
No change
Rating
96%
Review 4.8 out of 5
4.8
(36 reviews)
Next Milestone 40K
30K+
40K+
181
Ranks to Climb
-
Growth Needed
8,000,000
Active Installs
Pro
Unlock Exact Install Count
See the precise estimated active installs for this plugin, calculated from real-time ranking data.
- Exact install estimates within tiers
- Track install growth over time
- Milestone progress predictions
Need 9,680 more installs to reach 40K+
Rank Changes
Current
#1,115
Change
Best
#
Downloads Growth
Downloads
Growth
Peak
Upgrade to Pro
Unlock 30-day, 90-day, and yearly download history charts with a Pro subscription.
Upgrade NowReviews & Ratings
4.8
36 reviews
Overall
96%
5
34
(94%)
4
0
(0%)
3
1
(3%)
2
0
(0%)
1
1
(3%)
Tracked Keywords
Showing 4 of 4| Keyword | Position | Change | Type | Updated |
|---|---|---|---|---|
| rest-api | 67 | — | Tag | 21 hours ago |
| rest | 80 | — | Tag | 21 hours ago |
| JSON | 101 | — | Tag | 21 hours ago |
| disable | 175 | — | Tag | 21 hours ago |
Unlock Keyword Analytics
Track keyword rankings, search positions, and discover new ranking opportunities with a Pro subscription.
- Full keyword position tracking
- Historical ranking data
- Competitor keyword analysis
Track This Plugin
Get detailed analytics, keyword tracking, and position alerts delivered to your inbox.
Start Tracking FreePlugin Details
- Version
- 2.6.7
- Last Updated
- Mar 28, 2026
- Requires WP
- 4.7+
- Tested Up To
- 7.0
- PHP Version
- 5.6.20 or higher
- Author
- Jeff Starr
Support & Rating
- Rating
- ★ ★ ★ ★ ★ 4.8
- Reviews
- 36
- Support Threads
- 0
- Resolved
- 0%
Keywords
Upgrade to Pro
Unlock keyword rankings, search positions, and detailed analytics with a Pro subscription.
Upgrade NowFrequently Asked Questions
Common questions about Disable WP REST API
The REST API may not be needed for non-logged users
Disabling the REST API conserves server resources
Disabling the REST API minimizes potential attack vectors
Disabling the REST API prevents content scraping and plagiarism
I'm sure there are other valid reasons, but you get the idea :)
What is the default access-denied message?
When the user is logged in to WordPress, the normal REST API data will be displayed. When the user is not logged in, this is the default message:
{"code":"rest_login_required","message":"REST API restricted to authenticated users.","data":{"status":401}}
Disabling the REST API conserves server resources
Disabling the REST API minimizes potential attack vectors
Disabling the REST API prevents content scraping and plagiarism
I'm sure there are other valid reasons, but you get the idea :)
What is the default access-denied message?
When the user is logged in to WordPress, the normal REST API data will be displayed. When the user is not logged in, this is the default message:
{"code":"rest_login_required","message":"REST API restricted to authenticated users.","data":{"status":401}}
Log out of WordPress
Using a browser, request https://example.com/wp-json/
If you see the following message, REST is disabled:
"rest_login_required: REST API restricted to authenticated users."
Then if you log back in and make a new request for https://example.com/wp-json/, you will see that REST is working normally.
Does it disable REST functionality added by other plugins?
Yes. If the user is NOT logged in, this plugin disables ALL endpoints that are registered with the WP REST API. Otherwise, if the user IS logged in, then this plugin does not block anything.
Does this work with Gutenberg/Block Editor?
Yes. It works the same regardless of which editor (Classic or Block) you are using.
How to customize the error message?
By default the plugin displays a message for unauthenticated users: "REST API restricted to authenticated users." To customize that message to whatever you want, add the following code via functions.php or simple custom plugin:
function disable_wp_rest_api_error_custom($message) {
return 'Customize your message here.'; // change this to whatever you want
}
add_filter('disable_wp_rest_api_error', 'disable_wp_rest_api_error_custom');
How to allow access for Contact Form 7?
As explained in this thread, the plugin Contact Form 7 requires REST API access in order for the contact form to work. To allow for this, follow this guide.
Got a question?
Send any questions or feedback via my contact form
Using a browser, request https://example.com/wp-json/
If you see the following message, REST is disabled:
"rest_login_required: REST API restricted to authenticated users."
Then if you log back in and make a new request for https://example.com/wp-json/, you will see that REST is working normally.
Does it disable REST functionality added by other plugins?
Yes. If the user is NOT logged in, this plugin disables ALL endpoints that are registered with the WP REST API. Otherwise, if the user IS logged in, then this plugin does not block anything.
Does this work with Gutenberg/Block Editor?
Yes. It works the same regardless of which editor (Classic or Block) you are using.
How to customize the error message?
By default the plugin displays a message for unauthenticated users: "REST API restricted to authenticated users." To customize that message to whatever you want, add the following code via functions.php or simple custom plugin:
function disable_wp_rest_api_error_custom($message) {
return 'Customize your message here.'; // change this to whatever you want
}
add_filter('disable_wp_rest_api_error', 'disable_wp_rest_api_error_custom');
How to allow access for Contact Form 7?
As explained in this thread, the plugin Contact Form 7 requires REST API access in order for the contact form to work. To allow for this, follow this guide.
Got a question?
Send any questions or feedback via my contact form