Answer “Which location is nearest to me?”
On this page
Visitors sometimes ask the chatbot for the nearest location: "Which of your training centres is closest to Lyon?" or "Show me the 3 shops nearest to me." WPBot does not calculate distances or know where a visitor is. Here is what it can do, from simplest to most precise.
Option 1: answer from your location pages
The chatbot answers from your knowledge base. If each location has its own page or post with the city, region, postcode and address written out, the chatbot can match a visitor's city or region by name.
- Give each location a page, a post or an entry of a custom post type, with its city, region and address in the text.
- Are your location details in custom fields? Include them in the knowledge base: see Teach the chatbot your custom fields (ACF) (Professional and Master).
- Make sure that post type is ticked under Sources to include in WPBot Pro → AI / Settings → Knowledge Base, then sync. See The knowledge base: what the chatbot learns from.
- Add one overview page that lists every location by region. It gives the chatbot one place to find them all.
A visitor who asks "Do you have a training centre in the Lyon area?" then gets the locations that mention Lyon or its region, with links.
Note
This matches names, not distances. The chatbot does not know that one town is 20 km from another unless your content says so. For "nearest to me" answers, use option 2.
Option 2: let the chatbot ask your own location finder
With Connections to your API (Professional and Master), the chatbot can look something up in your own system while it chats. If you or your developer have a location finder that returns the closest locations for a postcode or city, connect it:
- Open WPBot Pro → ChatBot → AI Advanced.
- Under Connections to your API, add a connection, for example:
- Name: Find the nearest centre
- What it does (for the AI): "Finds the 3 training centres nearest to a postcode or city. Use it when a visitor asks where the closest centre is."
- HTTPS URL: the address of your location finder
- Method: GET or POST
- Fields:
postcode
- Click Save settings.
The chatbot asks the visitor for their postcode, calls your finder, and answers from what it returns, ranked the way your finder ranks them. See AI Advanced: chatbot skills and connections to your API.
Option 3: ask, then follow up yourself
An AI Action can ask for the visitor's city, what they are looking for and their email, and send it to you, so your team can reply with the right location. See AI Actions.
Check that it worked
Open your site in a private window and ask the chatbot "Which of your locations is closest to [a city you serve]?". Check that the answer names the right locations and links to their pages.
Related articles
- The knowledge base: what the chatbot learns from
- Teach the chatbot your custom fields (ACF)
- AI Advanced: chatbot skills and connections to your API
Availability
Option 1 works in every edition, including WPBot Free, with the pages and posts in your knowledge base. Custom fields (ACF) and Connections to your API need Professional or Master.
Was this article helpful?
Sorry about that. Get help another way:

