# Answer “Which location is nearest to me?”

> WPBot does not calculate distances. Answer location questions from your location pages, or connect your own location finder with Connections to your API.

Source: https://www.wpbot.pro/help/chatbot-location-based-answers/  
Section: Knowledge Base & Training › Knowledge base  
Updated: 2026-12-04

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.

1. Give each location a page, a post or an entry of a custom post type, with its city, region and address in the text.
2. Are your location details in custom fields? Include them in the knowledge base: see [Teach the chatbot your custom fields (ACF)](/help/chatbot-knowledge-base-custom-fields/) (Professional and Master).
3. 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](/help/chatbot-knowledge-base/).
4. 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:

1. Open **WPBot Pro → ChatBot → AI Advanced** .
2. 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`
3. 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](/help/chatbot-ai-advanced/).

## 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](/help/chatbot-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](/help/chatbot-knowledge-base/)
- [Teach the chatbot your custom fields (ACF)](/help/chatbot-knowledge-base-custom-fields/)
- [AI Advanced: chatbot skills and connections to your API](/help/chatbot-ai-advanced/)

## 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**.
