I have a custom post type (CPT) called directory. Within this CPT there are taxonomies such as builder, plumber, painter etc.

I would like to be able to add a location and a distance radius where the service is available.

Example 1

A post (A) has a location of London and a mile radius of 70 miles.

If a user searches for builder in cambridge then post A will appear in the search results.

Example 2

A post (A) has a location of London and a mile radius of 70 miles.

If a user searches for builder in Liverpool then post A will not appear in the search results.

The search fields have to search a taxonomy and the distance.

I've looked at the below plugins but not had much luck.


I think this is going down the bespoke route but if anyone can help out it will be much appreciated.


  • When you say location, do you literally mean the location is the string "London"? Or do you mean you have a latitude and longitude location that is inside London? If you're looking for something that knows the boundaries of London the area, and can project them out 70 miles and do a search in that area, then you'll be extremely lucky to find something. Even the big players in the market wouldn't do that
    – Tom J Nowell
    Aug 10, 2017 at 15:20
  • Looking at the plugins mentioned above, I believe they use the Google maps API to located the place and distance.
    – rikardo85
    Aug 10, 2017 at 15:32
  • an external api is only part of it. It allows for getting Lat/Lng values from a street or region, but you can't hit an api every time you need to know if post A is near post B or within region C.
    – hwl
    Aug 10, 2017 at 15:38
  • Thank you for the input. I did think this is going down a bespoke route rather than seeing if there was any plugins out there
    – rikardo85
    Aug 11, 2017 at 11:00
  • Any luck with this?
    – MikeiLL
    Oct 23, 2017 at 21:00


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.