{"id":2942,"date":"2026-10-20T08:40:00","date_gmt":"2026-10-20T07:40:00","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/location-switcher-and-search-bar-2\/"},"modified":"2026-10-20T08:40:00","modified_gmt":"2026-10-20T07:40:00","slug":"location-switcher-and-search-bar-2","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/location-manager\/location-switcher-and-search-bar-2\/","title":{"rendered":"How the location switcher works with the GeoDirectory search bar"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The location switcher and the search bar do two different jobs. The switcher sets the visitor&#8217;s current location and takes them to that location&#8217;s page. The search bar finds listings, and its Near field lets visitors enter a place as part of the search.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Location switcher<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The GD > Location Switcher block (shortcode <code>&#091;gd_location_switcher&#093;<\/code>, from the Location Manager add-on) lets visitors choose a country, region, city or neighbourhood, or &#8220;Near me&#8221;. When they pick one, they are sent to the page for that location, and category pages and listing blocks then filter for it. There is no search button: the choice itself triggers the change.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/location-manager\/gd-location-switcher\/\">GD > Location Switcher<\/a> for its options.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Searching by location instead<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If visitors on your site expect one form with a search button, use the Near field in the search bar instead of the switcher. With Location Manager active, the Near field suggests your locations as the visitor types, and the search runs when they press the search button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Results for a search with a location are ordered by distance, nearest first. The search page has no sort dropdown. For other ways to order results, see <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-features\/how-does-the-geodirectory-search-work\/\">how the GeoDirectory search works<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using both<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Many sites keep the search bar as the main way in on the home page and put the location switcher in the menu for visitors who want to browse one area. In the GD > Search block you can hide the main keyword input or the Near input with the &#8220;Hide Main Search Input&#8221; and &#8220;Hide Near Search Input&#8221; options if you only want one of them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The location switcher and the search bar do two different jobs. The switcher sets the visitor&#8217;s current location and takes them to that location&#8217;s page. The search bar finds listings, and its Near field lets visitors enter a place as part of the search. Location switcher The GD > Location Switcher block (shortcode &#091;gd_location_switcher&#093;, from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[213,425],"class_list":["post-2942","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-extensions-features","gd_placecategory-location-manager"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2942","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=2942"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2942\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2942"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2942"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}