Skip to content

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 in the VIP Dashboard to configure request blocks by IP address or by ranges of IP addresses.

The whois 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
// 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

Relevant to

  • WordPress