Tag: tracking

How to Sanitize user IP?

If the IP value returned from your server has a special character,you can use:wp_statistics_sanitize_user_ipfilter in your WordPress for getting real user IP from your $_SERVER. For example:If your $_SERVER:,, your real IP is: can use a final filter like this: Or if your $_SERVER: for=;proto=http;host=site.comAnd your real IP is: this […]

How to Stop Tracking in WP Statistics with PHP code?

Sometimes you need to enable the Anonymize IP Addresses with PHP code for GDPR. Here is an example to do that. add_action(‘init’, function (){ global $WP_Statistics; $WP_Statistics->update_option( ‘anonymize_ips’, ‘1’ ); });