Skip to content

Limiting Google Maps Autocomplete to Specific Countries on Your Website

Restrict Google Maps autocomplete to the countries you actually operate in, so address suggestions stop covering the whole world — and, on a single-country site, drop the country name from the address that gets saved.

2 minute read

If your website operates in only a few countries, you can configure Google Maps autocomplete to limit suggestions to a maximum of five countries. By default, autocomplete suggests locations from all countries.

A location search box with "be" typed in, suggesting Berlin in Germany, Bengaluru in India, Belo Horizonte in Brazil, Bergamo in Italy and Benidorm in Spain.
Without a restriction, one query returns places from five different countries.

Limiting autocomplete to selected countries

  1. 1 Edit the Location field

    Go to Listivo Panel > Custom Fields and edit the Location Field.

    A custom fields list with rows for Gallery, Attachments and Location, each with an Edit and a Delete button.
  2. 2 Select your countries

    In Country Restrictions (Max 5), search for and select the country you want to focus on, such as the United States of America.

    The Country Restrictions (Max 5) setting with United States of America already added, and an open country list showing Sweden, Switzerland, Syrian Arab Republic, Taiwan, Tajikistan and Tanzania.

Now, autocomplete will only suggest results from the United States or any other countries you have selected.

Enhanced feature for single-country operations

For those operating within a single country, we have integrated a special feature that omits the country name from the text address. Once the location setting is configured to one country, the address will no longer show the country name (e.g., no 'USA' at the end) as long as it is added via the front-end panel. This option is not available in the backend.

A front-end Location field with "be" typed in, now suggesting only US places — Beverly Hills CA, Bend OR, Bellingham WA, Bentonville AR and Berkeley CA — above a Google map of the eastern United States.

Test this feature by adding an advertisement via the front-end ad form. On cards and single listing pages, addresses will no longer display the country name at the end.

An address label with a pin icon reading "Beverly Hills, CA, USA".
Before: the country name is appended to the address.

The format will change as follows:

The same address label with a pin icon, now reading "Beverly Hills, CA".
After: with one country configured, the country name is dropped.

Note on limitations

Two things this does not do
Limiting the map to selected countries does not restrict the map's zoom capabilities — it is still possible to zoom out fully. And an address added via the backend will still have the country name appended, even when the field is configured for one country.

Ask the people who build Listivo

We answer by email from support@tangiblewp.com. With Premium Support, we also fix your site when something breaks.

Was this guide helpful?