Geolocation IP Detection icon
Utilities

Geolocation IP Detection hooks reference

  • By Benjamin Pick
  • v5.6.4
  • Updated

Geolocation IP Detection 5.6.4 has 2 actions and 43 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when Geolocation IP Detection fires an action
add_action( 'geoip_detect2_maxmind_ccpa_blacklist_do_upate', function() {
	// Your code runs here.
}, 10, 1 );

// Change a value Geolocation IP Detection is about to use
add_filter( 'geoip_detect2_locales', function( $locales ) {
	// Change $locales here.
	return $locales;
}, 10, 1 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • api.php line 60 · used in 5 places
    /**
     * Filter: geoip_detect2_locales
     */
    apply_filters( 'geoip_detect2_locales', $locales );
  • data-sources/auto.php line 290 · used in 2 places
    /**
     * Filter: Cron has fired. Find out if file should be updated now.
     */
    apply_filters( 'geoip_detect_cron_do_update', !GEOIP_DETECT_AUTO_UPDATE_DEACTIVATED, false );
  • api.php line 106 · used in 2 places
    /**
     * Filter: geoip_detect2_record_data_after_cache After loading the information
     * from the Geolocation-Database AND after the cache, you can add information
     * to it.
     */
    apply_filters( 'geoip_detect2_record_data_after_cache', $data, $ip );
  • api.php line 72 · used in 2 places
    /**
     * Filter: geoip_detect2_record_data_override_lookup Before doing the lookup,
     * changing the data (similar to a cache but also when skipCache is on).
     */
    apply_filters( 'geoip_detect2_record_data_override_lookup', $data, $ip, $options );
  • legacy-api.php line 81
    /**
     * Filter: geoip_detect_record_information After loading the information from
     * the Geolocation database, you can add or remove information from it.
     */
    apply_filters( 'geoip_detect_record_information', $record, $ip );
  • lib/get-client-ip.php line 36
    /**
     * By default, all internal IPs may be reverse proxies.
     */
    apply_filters( 'geoip_detect2_client_ip_whitelist_internal_ips', true );
  • lib/dynamic-reverse-proxies/abstract.php line 132
    /**
     * Filter: Cron has fired. Find out if dynamic reverse proxy data should be
     * updated now.
     */
    apply_filters( 'geoip_detect2_dynamic-reverse-proxies_do_automatic_update', true );
  • lib/ccpa.php line 100
    /**
     * Filter: geoip_detect2_maxmind_ccpa_blacklist_ip_subnets
     */
    apply_filters( 'geoip_detect2_maxmind_ccpa_blacklist_ip_subnets', $list );
  • lib/ccpa.php line 261
    /**
     * Filter: Cron has fired. Find out if ccpa data should be updated now.
     */
    apply_filters( 'geoip_detect2_maxmind_ccpa_do_automatic_update', true );
  • lib/ccpa.php line 190
    /**
     * With this filter, you can disable checking the Maxmind Server for CCPA
     * blacklist updates.
     */
    apply_filters( 'geoip_detect2_maxmind_ccpa_do_update', true );
  • lib/ccpa.php line 46
    /**
     * With this filter, you can disable checking the blacklist from Maxmind. If
     * you do so, make sure you are compliant to the EULA in a different way.
     */
    apply_filters( 'geoip_detect2_maxmind_ccpa_enabled', true );
  • geoip-detect-lib.php line 58
    /**
     * Filter: geoip_detect2_options You can programmatically change the defaults
     * etc.
     */
    apply_filters( 'geoip_detect2_options', $options );
  • geoip-detect-lib.php line 108
    /**
     * Filter: geoip_detect2_reader You can customize your reader here. This filter
     * will be called for every IP request.
     */
    apply_filters( 'geoip_detect2_reader', $reader, $locales );
  • geoip-detect-lib.php line 250
    /**
     * Filter: geoip_detect2_record_data After loading the information from the
     * Geolocation database, you can add information to it.
     */
    apply_filters( 'geoip_detect2_record_data', $data, $ip );
  • api.php line 119
    /**
     * Filter: geoip_detect2_record_information Use
     * geoip_detect2_record_data_after_cache instead if you want to modify the
     * data.
     */
    apply_filters( 'geoip_detect2_record_information', $original_record, $ip, $locales );
  • shortcodes/select.php line 153
    /**
     * Filter: geoip_detect2_shortcode_country_select_countries Change the list of
     * countries that should show up in the select box. You can add, remove,
     * reorder countries at will. If you want to add a blank value (for seperators
     * or so), use a key name that starts with 'blank_' and then something at will
     * in case you need several of them.
     */
    apply_filters( 'geoip_detect2_shortcode_country_select_countries', $countries, $attr );
  • shortcodes/show_if.php line 116
    /**
     * You can override the detected location information here. E.g. "Show if in
     * Paris, but if the user has given an adress in his profile, use that city
     * instead" (Does not work in AJAX mode)
     */
    apply_filters( 'geoip_detect2_shortcode_show_if_ip_info_override', $info, $attr, $showContentIfMatch );
  • data-sources/header.php line 60
    /**
     * Customize which key in the $_SERVER array (Request headers) should be used
     * for Geo-Detection The country should be given in 2-letter ISO 3166-1 codes,
     * uppercase (DE) or lowercase (de).
     */
    apply_filters( 'geoip_detect2_source_header_http_key', $httpKey, $this->options['provider'] );
  • shortcodes/cf7.php line 214
    /**
     * Filter: geoip2_detect_wpcf7_special_mail_tags This filter is called if a
     * GeoIP-detection-tag was used.
     */
    apply_filters( 'geoip2_detect_wpcf7_special_mail_tags', $lines, $name, $isHtml );
  • data-sources/auto.php line 123 · used in 2 places
    apply_filters( 'geoip_detect_get_abs_db_filename', $data_filename );
  • data-sources/manual.php line 76 · used in 2 places
    apply_filters( 'geoip_detect_source_get_status_HTML_maxmind', $html, $this->getId() );
  • data-sources/auto.php line 177 · used in 2 places
    apply_filters( 'geoip_detect2_download_url', $download_url );
  • geoip-detect-lib.php line 473
    apply_filters( 'geiop_detect_ipservices', $ipservices );
  • api.php line 285
    apply_filters( 'geoip_detect_enqueue_javascript', true, $reason );
  • api.php line 286
    apply_filters( "geoip_detect_enqueue_javascript_{$reason}", $do_it );
  • data-sources/auto.php line 132
    apply_filters( 'geoip_detect_get_abs_mmdb_filename', $filename );
  • api.php line 273
    apply_filters( 'geoip_detect_get_external_ip_adress', $ip_cache );
  • ajax.php line 58
    apply_filters( 'geoip_detect2_ajax_allowed_domains', $allowed_domains );
  • ajax.php line 144
    apply_filters( 'geoip_detect2_ajax_localize_script_data', $data );
  • ajax.php line 63
    apply_filters( 'geoip_detect2_ajax_options', [] );
  • ajax.php line 68
    apply_filters( 'geoip_detect2_ajax_record_data', $data, isset($data['traits']['ip_address']) ? $data['traits']['ip_address'] : '' );
  • lib/get-client-ip.php line 102
    apply_filters( 'geoip_detect2_client_ip', $ip, $ip_list );
  • lib/get-client-ip.php line 46
    apply_filters( 'geoip_detect2_client_ip_use_whitelist', false );
  • lib/get-client-ip.php line 45
    apply_filters( 'geoip_detect2_client_ip_whitelist', $this->proxyWhitelist );
  • lib/dynamic-reverse-proxies/aws.php line 19
    apply_filters( 'geoip_detect2_dynamic_reverse_proxies_aws_pre_ranges', $ip_ranges );
  • lib/dynamic-reverse-proxies/aws.php line 9
    apply_filters( 'geoip_detect2_dynamic_reverse_proxies_aws_types', ['CLOUDFRONT'] );
  • lib/dynamic-reverse-proxies/aws.php line 8
    apply_filters( 'geoip_detect2_dynamic_reverse_proxies_aws_urls', 'https://ip-ranges.amazonaws.com/ip-ranges.json' );
  • lib/dynamic-reverse-proxies/cloudflare.php line 8
    apply_filters( 'geoip_detect2_dynamic_reverse_proxies_cloudflare_urls', ['https://www.cloudflare.com/ips-v4', 'https://www.cloudflare.com/ips-v6'] );
  • lib/dynamic-reverse-proxies/abstract.php line 68
    apply_filters( 'geoip_detect2_dynamic_reverse_proxies_ips', $ips, $forceSave );
  • lib/ccpa.php line 276
    do_action( 'geoip_detect2_maxmind_ccpa_blacklist_do_upate' );
  • lib/ccpa.php line 161
    apply_filters( 'geoip_detect2_maxmind_ccpa_blacklist_url', 'api.maxmind.com/privacy/exclusions' );
  • admin-ui.php line 237
    do_action( 'geoip_detect2_options_changed' );
  • shortcodes/show_if.php line 85
    apply_filters( 'geoip_detect2_shortcode_show_if_else_seperator', '[else]' );
  • shortcodes/show_if.php line 191
    apply_filters( 'geoip_detect2_shortcode_show_if_parsed_result', $parsed, $attr, !$hide_if );
  • data-sources/registry.php line 125
    apply_filters( 'geoip2_detect_sources_not_cachable', [ 'auto', 'manual', 'header' ] );

Generated from Geolocation IP Detection's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: