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' );
});

Leave Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.