Title: Block by IP
Author: WordPress VIP Documentation
Published: September 16, 2025

---

 1. [Security Controls](https://docs.wpvip.com/security-controls/)
 2. [Block unwanted origin requests with PHP](https://docs.wpvip.com/security-controls/block-origin-requests-with-php/)
 3. Block by IP

#  Block by IP

Use the `VIP_Request_Block::ip()` method to block requests by IP addresses.

**Note**

The  `VIP_Request_Block::ip()` method cannot be used to block IP ranges (aka subnets).
As an alternative, use [the **IP Restrictions** panel](https://docs.wpvip.com/security-controls/ip-restrictions/)
in the VIP Dashboard to configure request blocks by IP address or by ranges of IP
addresses.

The `[whois](https://www.arin.net/resources/registry/whois/rws/cli/)` terminal command
can be used to query an IP address in order to make a more educated decision about
which IP addresses are suitable to be blocked.

Use caution to avoid blocking a reverse proxy IP instead of the client’s IP. Blocking
the IP of a reverse proxy will result in legitimate traffic being blocked.

vip-config/vip-config.php

    ```lang-php
    // Example VIP_Request_Block::ip( string $value );
    if ( class_exists( 'VIP_Request_Block' ) ) {
       VIP_Request_Block::ip( '13.37.13.37' );
       VIP_Request_Block::ip( '13.37.13.38' );
    }
    ```

Last updated: September 16, 2025