Add this php script into your functions.php to be able to control which parts of a location is shown.
PHP Code SnippetAfter installing a child theme, navigate to Appearance > Theme Editor > functions.php and paste at the bottom of the input.
Instructions
This script will add a mod called “get address parts”.
Depending on the values you enter in the mod it will only show that part of the location string.
For example I use the “full address” location, and set the “get address parts” to the value: 1, -1
This gives me the first and last parts of the location string, which is: city, country
Entering different values into the mod will give you different parts of the location string.
Only thing you have to be cautious about is the all users enter the same type of location value. If some enter a shorter or longer value the mod could remove unwanted parts. Hence why I just use it for the first and last part, since they are always the same.
NOTE: I'm using mapbox. Not sure how Google maps output the strings - but I'm thinking it's the same.