Title: programmatically whitelist ips
Last modified: January 10, 2021

---

# programmatically whitelist ips

 *  Resolved [foxpc](https://wordpress.org/support/users/foxpc/)
 * (@foxpc)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/programmatically-whitelist-ips-2/)
 * Hi,
    is there are some function that programmatically i can whitelist some ips?
   i want on each site that user activate the plugin to whitelist ips. i have seen
   that is possible to add `define('JETPACK_IP_ADDRESS_OK', 'X.X.X.X');` to config.
   php, but i am looking to do this from mu plugin.
 * Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Dan (a11n)](https://wordpress.org/support/users/drawmyface/)
 * (@drawmyface)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/programmatically-whitelist-ips-2/#post-13890928)
 * Hi there
 * That data is stored in a Jetpack option, `protect_whitelist`, on the site.
 * You could call the `jetpack_protect_save_whitelist` function to do that manually:
   
   [https://github.com/Automattic/jetpack/blob/46639611ef2fd917bdda594c765c0a85d8ec08b0/modules/protect/shared-functions.php#L83-L91](https://github.com/Automattic/jetpack/blob/46639611ef2fd917bdda594c765c0a85d8ec08b0/modules/protect/shared-functions.php#L83-L91)
 * Or alternatively, you Or could use the CLI wrapper to run the command when the
   site is created, for example:
    [https://github.com/Automattic/jetpack/blob/9222df3c888953e6f0d867e4c4d0e0e47c1ad5f2/class.jetpack-cli.php#L562-L577](https://github.com/Automattic/jetpack/blob/9222df3c888953e6f0d867e4c4d0e0e47c1ad5f2/class.jetpack-cli.php#L562-L577)
 * Hope that helps!

Viewing 1 replies (of 1 total)

The topic ‘programmatically whitelist ips’ is closed to new replies.

 * ![](https://ps.w.org/jetpack/assets/icon.svg?rev=2819237)
 * [Jetpack - WP Security, Backup, Speed, & Growth](https://wordpress.org/plugins/jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Dan (a11n)](https://wordpress.org/support/users/drawmyface/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/programmatically-whitelist-ips-2/#post-13890928)
 * Status: resolved