WP Manifestindependent plugin directory
manifest / forms / rs-gravity-forms-ip-block

RS Gravity Forms IP Block

[WordPress Plugin] Provides an IP address filter with the option to automatically delete (or mark as spam) entries that match the block list.

by Radley Sustaire · github.com/radgh/rs-gravity-forms-ip-block

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/radgh/rs-gravity-forms-ip-block/archive/refs/heads/master.zip

Declares an update source (https://github.com/RadGH/RS-Gravity-Forms-IP-Block), so updates arrive through the plugin's own updater.

Readme

RS Gravity Forms IP Block (WordPress Plugin)

Block IP addresses from submitting Gravity Forms.

To use this plugin, add this code to functions.php and replace the IP list with your own:

// Specify custom block list
function theme_get_gf_ip_block_list( $ip_list ) {
    return array(
        'xxx.xxx.xxx.xxx',
    );
}
add_filter( 'rsgf/get_ip_block_list', 'theme_get_gf_ip_block_list' );

To instantly delete blocked entries add:

add_filter( 'rsgf/delete_blocked_entries', '__return_true' );

The IP address is based on these server variables:

  • PHP (Default): $_SERVER['REMOTE_ADDR']
  • Cloudflare: $_SERVER['HTTP_CF_CONNECTING_IP']

Changelog

1.0.1

  • Specified ip "block" list in filters and function names
  • Renamed function in readme example

1.0.0

  • Initial release

Read the full README on GitHub →