Title: Whitelisting for using REST API
Last modified: November 22, 2017

---

# Whitelisting for using REST API

 *  Resolved [Torsten](https://wordpress.org/support/users/knodderdachs/)
 * (@knodderdachs)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/whitelisting-for-using-rest-api/)
 * Hi,
 * I have to use the REST API for one plugin, but I don’t want others to have access
   to the REST API. Is it possible (in the Pro Version of NinjaFirewall) to whitelist
   specific IP just for accessing the REST API while other IP getting blocked?
 * Greetings
    Torsten

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/whitelisting-for-using-rest-api/#post-9714404)
 * Hi,
 * I assume you are referring to the WP+ Edition, because the Pro and Pro+ are generic
   versions (i.e., not WordPress specific). There is indeed an IP whitelist option
   but we noticed a bug that does not whitelist the user when accessing the REST
   API. It will be fixed in the next release, available next month.
 * In the meantime, if you are using Apache you can temporarily use some .htaccess
   rewrite rules:
 *     ```
       RewriteEngine On
       RewriteCond %{REMOTE_ADDR} !1.2.3.4
       RewriteCond %{THE_REQUEST} /wp-json/wp/v2/
       RewriteRule . - [F,L]
       ```
   
 * Replace `1.2.3.4` with your IP. Be careful not to remove the `!` character preceding
   the IP.
    Not the most elegant way (and not 100% bullet-proof) but it should work
   well as a temporary solution.
 *  Thread Starter [Torsten](https://wordpress.org/support/users/knodderdachs/)
 * (@knodderdachs)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/whitelisting-for-using-rest-api/#post-9716681)
 * Hi,
 * thanks for helping. Unfortunately the rewrite rule doesn’t work. It makes no 
   difference. In the logfile I see that the IP is whitelisted but then it gets 
   blocked. I think I have to wait for the bugfix in the next release.
 * Greetings
    Torsten

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Whitelisting for using REST API’ is closed to new replies.

 * ![](https://ps.w.org/ninjafirewall/assets/icon-256x256.png?rev=976137)
 * [NinjaFirewall (WP Edition) - Advanced Security Plugin and Firewall](https://wordpress.org/plugins/ninjafirewall/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ninjafirewall/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ninjafirewall/)
 * [Active Topics](https://wordpress.org/support/plugin/ninjafirewall/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ninjafirewall/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ninjafirewall/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Torsten](https://wordpress.org/support/users/knodderdachs/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/whitelisting-for-using-rest-api/#post-9716681)
 * Status: resolved