Kuvaus
Does one thing: Completely disables the WordPress REST API for visitors who are not logged into WordPress. No configuration required.
Important: This plugin completely disables the WP REST API for visitors who are NOT logged in to WordPress. So not recommended if your site needs the WP REST API for any non-logged users.
👉 The fast, simple way to prevent abuse of your site’s REST/JSON API
👉 Protects your site’s REST data from all non-logged users and bots
👉 Uses only 4KB of code, so super lightweight, fast, and effective
🛠️ Pro version available! Check out REST Pro Tools »
Features
- Estää REST/JSON vierailijoilta (Kirjautumattomat käyttäjät)
- Estää REST headerin HTTP vastauksessa kaikilta käyttäjiltä.
- Estää REST linkit HTML -otsikossa kaikille käyttäjille.
- 100% liitä-ja-käytä, aseta ja unohda -ratkaisu.
How does it work?
This plugin completely disables the WP REST API unless the user is logged into WordPress.
- For logged-in (authenticated) users, WP REST API works normally
- For logged-out (unauthenticated) users, WP REST API is disabled
Mitä tapahtuu, jos kirjautumaton vierailija tekee JSON/REST -pyynnön? He saavat ainoastaan yksinkertaisen herjan:
rest_login_required: REST API restricted to authenticated users.
Tämä viesti voidaan kustomoida filtteri-koukun välityksellä,
disable_wp_rest_api_error. Tarkista tämä postaus nähdäksesi, kuinka toimenpide tapahtuu.
Pro Version
🛠️ Check out the Pro version, REST Pro Tools, loaded with many awesome features:
- One-click disable all routes
- One-click disable all /users routes
- Disable any specific user routes based on role
- Whitelist any user IDs
- Whitelist any IP addresses
- Customize the REST error message
- Customize the REST response code
- Always require or force SSL/TLS
- Disable all JSONP shenanigans
- One-click disable any REST API headers
- Add any post meta (custom field) to REST API
- Add any user meta (custom field) to REST API
- Add routes for site profile and author profile
- Add routes for featured images and post categories
- Add routes for post taxonomies and terms
- At-a-glance check status of REST API
The free version does only one thing: disables REST API for unauthenticated users. The PRO version can do that and much more! Take full control of the REST API with REST Pro Tools »
Privacy
This plugin does not collect or store any user data. It does not set any cookies, and it does not connect to any third-party locations. Thus, this plugin does not affect user privacy in any way. If anything it improves user privacy, as it protects potentially sensitive information from being displayed/accessed via REST API.
Disable WP REST API is developed and maintained by Jeff Starr, 15-year WordPress developer and book author.
Support development of this plugin
I develop and maintain this free plugin with love for the WordPress community. To show support, you can make a donation or purchase one of my books:
- The Tao of WordPress
- Digging into WordPress
- .htaccess made easy
- WordPress Themes In Depth
- Wizard’s SQL Recipes for WordPress
And/or purchase one of my premium WordPress plugins:
- BBQ Pro – Blazing fast WordPress firewall
- Blackhole Pro – Automatically block bad bots
- Banhammer Pro – Monitor traffic and ban the bad guys
- GA Google Analytics Pro – Connect WordPress to Google Analytics
- Head Meta Pro – Ultimate Meta Tags for WordPress
- REST Pro Tools – Awesome tools for managing the WP REST API
- Simple Ajax Chat Pro – Unlimited chat rooms
- USP Pro – Unlimited front-end forms
Links, tweets and likes also appreciated. Thank you! 🙂
Asennus
Asennusohjeet
- Lataa liitännäinen blogiisi ja aktivoi.
- Valmista! Enempää konfigurointia ei enää tarvita.
More info on installing WP plugins
Testaus
Testataksesi liitännäisen toiminnallisuuden, kirjaudu ulos WordPress -järjestelmästä ja tee URL-pyyntö https://example.com/wp-json/ selaimessa. UKK:sta näet lisätietoja.
Pro Version
Need more control of the WP REST API? Check out the Pro version »
Pidätkö tästä liitännäisestä?
Jos tykkäät estää WP REST rajapinnan, ole ystävällinen ja käytä hetki antamalla 5-tähden arvio. Se auttaa pitämään kehityksen ja tuen jatkossakin vahvana. Kiitos!
Uninstalling
To uninstall/remove the plugin, visit the Plugins screen, deactivate and delete the plugin. This plugin makes no changes to the WP database.
UKK
-
Miksi kukaan haluaisi estää REST Rajapinnan?
-
Technically this plugin disables REST API only for visitors who are not logged into WordPress. With that in mind, here are some good reasons why someone would want to disable REST API for non-logged users:
- REST rajapintaa ei saateta tarvita kirjautumattomille käyttäjille.
- Poistamalla käytöstä REST rajapinta suojellaan palvelimen resursseja.
- Poistamalla käytöstä REST Rajapinta minimoidaan potentiaaliset hyökkäysilmiöt.
- Poistamalla käytöstä REST -rajapinnan estetään sisällön kaaviminen ja plagiointi.
Olen varma, että on olemassa muita päteviä syitä, mutta ymmärtänet idean 🙂
-
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}} -
Kuinka testaan, onko REST estetty?
-
Testaaminen on helppoa:
- Kirjaudu ulos
- Käyttäen selainta, tee URL-pyyntö
https://example.com/wp-json/
Jos näet seuraavan viestin, rajapinta on poissa käytöstä:
”rest_login_required: REST Rajapinta rajoitettu ainoastaan tunnistautuneille käyttäjille.”
Sitten, jos kirjaudut takaisin ja teet uuden pyynnön osoitteeseen
https://example.com/wp-json/, tulet huomaamaan, että rajapinta toimii normaalisti. -
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
Arvostelut
Avustajat & Kehittäjät
“Poista käytöstä REST Rajapinta” perustuu avoimeen lähdekoodiin. Seuraavat henkilöt ovat osallistuneet tämän lisäosan kehittämiseen.
Avustajat“Poista käytöstä REST Rajapinta” has been translated into 8 locales. Kiitoksia kääntäjille heidän työstään.
Käännä “Poista käytöstä REST Rajapinta” omalle kielellesi.
Oletko kiinnostunut kehitystyöstä?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Muutosloki
Jos tykkäät estää WP REST rajapinnan, ole ystävällinen ja käytä hetki antamalla 5-tähden arvio. Se auttaa pitämään kehityksen ja tuen jatkossakin vahvana. Kiitos!
🛠️ Pro version now available! Get granular control over the REST API with REST Pro Tools »
2.6.8
- Improves readme.txt documentation
- Adds blurb about new pro version
- Tests on WordPress 7.0
Full changelog @ https://plugin-planet.com/wp/changelog/disable-wp-rest-api.txt