{"id":2930,"date":"2026-10-20T08:39:21","date_gmt":"2026-10-20T07:39:21","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/search-within-distance-of-city-2\/"},"modified":"2026-10-20T08:39:21","modified_gmt":"2026-10-20T07:39:21","slug":"search-within-distance-of-city-2","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/advanced-search\/search-within-distance-of-city-2\/","title":{"rendered":"How to search within a set distance of a city"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When a visitor types a town or address into the Near field of the GeoDirectory search bar, the search is centred on that place and returns listings within a radius around it. It works the same way as searching near the visitor&#8217;s own position.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Set the default radius<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">GeoDirectory &gt; Settings &gt; General &gt; Search &gt; Search near radius sets how far from the searched place results can be. The default is 7, in miles or kilometres depending on the Search distances setting on the same screen. A small radius returns little or nothing when listings are spread out, so raise it to suit your area.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Let visitors choose the distance<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With the Advanced Search add-on, add the Search By Distance field to the search form in your post type&#8217;s search settings. Visitors then pick a distance, and their choice replaces the default radius. The distance only applies when the search has a centre point, either a place typed into Near or the visitor&#8217;s location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/advanced-search\/advanced-search-setup-guide\/\">Advanced Search setup guide<\/a> and <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/advanced-search\/settings-overview-for-cpt-settings-search\/\">Settings overview for CPT &gt; Settings &gt; Search<\/a> for adding fields.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What the keyword box searches<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The main search box matches listing titles and descriptions, and the names of categories and tags. It does not look inside other custom fields. To let people search by a value such as fuel type, make it a select or checkbox field and add it as an Advanced Search filter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If a keyword search near a town returns nothing, check that the word is in the title or description of listings within the radius, and that the post type selector is set to the post type those listings belong to. <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-features\/how-does-the-geodirectory-search-work\/\">How does the GeoDirectory search work<\/a> explains the search in more detail.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When a visitor types a town or address into the Near field of the GeoDirectory search bar, the search is centred on that place and returns listings within a radius around it. It works the same way as searching near the visitor&#8217;s own position. Set the default radius GeoDirectory &gt; Settings &gt; General &gt; Search [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[213,400],"class_list":["post-2930","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-extensions-features","gd_placecategory-advanced-search"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=2930"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2930\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2930"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2930"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}