Let’s get started
Take your business to next level
Become part of our growing family of +600,000 users and get the tools you need to make smart choices for your website. Simple, powerful insights are just a click away.
Available since version 14.11.4
The wp_statistics_location_column_value
filter allows you to modify the location string displayed in WP Statistics reports. This hook provides access to location data such as the city, region, and full location, which you can customize to meet your needs.
The filter passes the following parameters:
$result
(string): The current location string (the default value that will be displayed).$location
(string): The country code, e.g. US.$region
(string): The region part of the location (if available).$city
(string): The city part of the location (if available).Add the following hooks to the functions.php
file of your active theme.
add_filter('wp_statistics_location_column_value', function($result, $location, $region, $city) {
$result = $city;
return $result;
}, 10, 4);
add_filter('wp_statistics_location_column_value', function($result, $location, $region, $city) {
$result = $city . ' - ' . $region;
return $result;
}, 10, 4);
Become part of our growing family of +600,000 users and get the tools you need to make smart choices for your website. Simple, powerful insights are just a click away.