{"id":943,"date":"2025-03-24T14:28:05","date_gmt":"2025-03-24T14:28:05","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-to-filter-search-results-by-category\/"},"modified":"2025-04-03T15:24:26","modified_gmt":"2025-04-03T14:24:26","slug":"how-to-filter-search-results-by-category","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/how-to-filter-search-results-by-category\/","title":{"rendered":"How to filter search results by category?"},"content":{"rendered":"\n<p>GeoDirectory makes it easy for users to browse by category, and the Advanced Search Filters addon makes it possible to filter search results by category.<\/p>\n\n\n\n<p><a href=\"https:\/\/wpgeodirectory.com\/downloads\/advanced-search-add-on\/\" target=\"_blank\" rel=\"noopener\">Get the Advanced Search Addon for GeoDirectory<\/a><\/p>\n\n\n\n<p><strong>Steps<\/strong><\/p>\n\n\n\n<p>To enable the Category filter follow these steps&nbsp;<\/p>\n\n\n\n<p>Activate the Advanced Search Addon<\/p>\n\n\n\n<p>Visit the CPT Search Settings for the Custom Post Type (CPT) you want to filter by category. For example: <strong><em>WP Admin -&gt; Places -&gt; Settings -&gt; Search<\/em><\/strong><\/p>\n\n\n\n<p>Find the Category field on the left. Click once to add the filter to the right.<\/p>\n\n\n\n<p>Adjust the settings, marking the option &#8220;Main search bar?&#8221; to include the option as a select field dropdown in the search bar.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" sizes=\"auto, (max-width: 920px) 100vw, 920px\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-PLDshZQACj-1024x552.png 1024w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-PLDshZQACj-300x162.png 300w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-PLDshZQACj-768x414.png 768w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-PLDshZQACj-1536x828.png 1536w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-PLDshZQACj.png 1892w\" width=\"920\" height=\"496\" class=\"attachment-large size-large\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-PLDshZQACj-1024x552.png\" alt=\"\"><br>Now the category filter should be visible in the search bar for that CPT.<\/p>\n\n\n\n<p>Repeat this step for each CPT.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-2rOdhWTfvq-1024x199.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GeoDirectory makes it easy for users to browse by category, and the Advanced Search Filters addon makes it possible to filter search results by category. Get the Advanced Search Addon for GeoDirectory Steps To enable the Category filter follow these steps&nbsp; Activate the Advanced Search Addon Visit the CPT Search Settings for the Custom Post [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[545,803,804],"article\/categories":[211,432],"class_list":["post-943","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-filters","gd_place_tags-cat-filter","gd_place_tags-search-filter","gd_placecategory-tips-tricks-more","gd_placecategory-how-tos"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/943","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=943"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/943\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=943"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=943"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}