{"id":28195,"date":"2021-08-14T15:00:07","date_gmt":"2021-08-14T13:00:07","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=28195"},"modified":"2021-08-13T13:19:20","modified_gmt":"2021-08-13T11:19:20","slug":"how-to-add-search-by-category-feature-in-wordpress","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/how-to-add-search-by-category-feature-in-wordpress\/","title":{"rendered":"How to Add a &#8220;Search by Categories&#8221; Feature in WordPress"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]Allowing the users to search your posts by category is <strong>one of the proven ways to improve your website\u2019s UX<\/strong>, as the users get to navigate your website faster and with greater ease. <strong>This type of search is particularly useful on bigger websites with lots of diverse content<\/strong> as it allows users to search in a specific category instead of the entire website, and get more exact results.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Nevertheless, <strong>the \u201csearch by categories\u201d feature can also prove to be quite effective on smaller websites<\/strong> as long as the content is nicely split into adequate categories. The primary purpose of categories, which are part of the <a href=\"https:\/\/qodeinteractive.com\/magazine\/wordpress-taxonomy\/\">default WordPress taxonomies<\/a>, is to make it easier for your users to find what they came to your website for, so practically <strong>any type of website, regardless of the size, scope and nature, can benefit from this feature.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In this article, we will show you<strong> how to add a \u201csearch by categories\u201d feature to your website all by yourself, with a free plugin<\/strong> and without any additional investments, in just a couple of steps. But, bear in mind that your website will benefit from this feature only if your content is well-organized in categories.[\/vc_column_text][vc_empty_space height=&#8221;80px&#8221;][vc_widget_sidebar sidebar_id=&#8221;new-top-picks-banner&#8221;][vc_empty_space height=&#8221;80px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">About WordPress Categories and Subcategories<\/h2>\n<p>[\/vc_column_text][vc_column_text]Before we jump to explaining how to add the search by category feature to your site, let\u2019s just briefly remind you <strong>why splitting the content into categories and subcategories is useful<\/strong> and how many categories is best to have.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder    \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"554\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/About-WordPress-Categories-and-Subcategories.jpg\" class=\"attachment-full size-full\" alt=\"About WordPress Categories and Subcategories\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/About-WordPress-Categories-and-Subcategories.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/About-WordPress-Categories-and-Subcategories-300x172.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/About-WordPress-Categories-and-Subcategories-768x439.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/About-WordPress-Categories-and-Subcategories-620x354.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Apart from the obvious benefits of having a well-structured website, like improved user experience, better bounce rates, and similar &#8211; <strong>another possible advantage of introducing categories to your posts and pages is improved SEO<\/strong>. This is especially the case when you manage to <strong>use the right keywords to name the categories.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]The number of categories you can have on your website is not limited, but the practice shows it is best to stick to a few. <strong>Too many categories give off just as messy and cluttered an impression as a website with no categories at all.<\/strong> Five to ten categories have proven to be the optimal number and if you are just starting out you&#8217;ll probably be fine with three categories to begin with. It\u2019s also important to <strong>avoid categories that include only a few posts<\/strong> as a category is usually constituted of a large number of posts that cover related topics. And <strong>in case you want to classify your posts better, you can also add subcategories.<\/strong> A fashion website can, for example, have the swimwear category, where one-piece and two-piece swimming suits will be two subcategories.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]When you are sure you have organized your website well and sorted your content into categories properly, you are ready to add the \u201csearch by categories\u201d feature to your website.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">How to Add a &#8220;Search by Categories&#8221; Feature Using a Plugin<\/h2>\n<p>[\/vc_column_text][vc_column_text]<a href=\"https:\/\/wordpress.org\/plugins\/add-search-to-menu\/\" target=\"_blank\" rel=\"noopener\">Ivory Search<\/a> is an excellent, free plugin with stellar ratings and more than 70,000 active installations.<strong> User-friendliness, simplicity, and efficacy are the core features<\/strong> that made it popular for such a large number of users. With this advanced plugin, you can <strong>easily add an unlimited number of search forms anywhere on your website<\/strong>. It allows you to <strong>configure each form individually<\/strong> so that your users can perform a variety of different search types on your website.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To install it, follow the routine installation procedure, typical of any other WordPress plugin. In case you need some assistance, you can always take a look at our <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-install-a-wordpress-plugin\/\">detailed guide on WordPress plugin installation<\/a>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"502\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Ivory-Search.jpg\" class=\"attachment-full size-full\" alt=\"Ivory Search\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Ivory-Search.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Ivory-Search-300x155.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Ivory-Search-768x398.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Ivory-Search-620x321.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]After you installed the plugin, you will notice a new menu item in the lefthand menu &#8211;<strong> Ivory Search<\/strong>. Click on the <strong>Search Forms<\/strong> option to go to the plugin\u2019s options page and then click on the <strong>Add New Search Form<\/strong> button.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"506\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Add-New-Search-Form.jpg\" class=\"attachment-full size-full\" alt=\"Add New Search Form\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Add-New-Search-Form.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Add-New-Search-Form-300x157.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Add-New-Search-Form-768x401.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Add-New-Search-Form-620x324.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]The next step is to build your new search form. The first thing you need to do here is to come up with a name for your search form and enter it in the designated field. This name will not be visible anywhere else but in the admin panel and its purpose is purely administrative.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"601\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Insert-Name.jpg\" class=\"attachment-full size-full\" alt=\"Insert Name\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Insert-Name.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Insert-Name-300x186.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Insert-Name-768x476.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Insert-Name-620x385.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Before you save the new search form, you need to adjust some settings. First, go to the<em><strong> Post Types<\/strong><\/em> option, click on it for the menu to expand and then choose what type of content you want to add to the search. You can select posts, media, products, pages and templates.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"503\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Post-Types.jpg\" class=\"attachment-full size-full\" alt=\"Post Types\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Post-Types.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Post-Types-300x156.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Post-Types-768x399.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Post-Types-620x322.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]After you made your choice, go to Posts option, click on it for the menu to expand, and turn on the <em><strong>Search posts of only selected taxonomies<\/strong><\/em> toggle. This is necessary as it allows you to choose the WordPress categories you can add to the search.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"485\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Selected-Taxonomies.jpg\" class=\"attachment-full size-full\" alt=\"Selected Taxonomies\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Selected-Taxonomies.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Selected-Taxonomies-300x150.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Selected-Taxonomies-768x384.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Selected-Taxonomies-620x310.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]After you have selected a category or a few of them, it is time to click on the <em><strong>Save Form<\/strong><\/em> button.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]A new custom shortcode for the new search form is automatically created and the next thing you need to do is to copy and paste it into a text file.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"995\" height=\"478\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Save-Form.jpg\" class=\"attachment-full size-full\" alt=\"Save Form\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Save-Form.jpg 995w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Save-Form-300x144.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Save-Form-768x369.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Save-Form-970x466.jpg 970w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Save-Form-620x298.jpg 620w\" sizes=\"auto, (max-width: 995px) 100vw, 995px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]This shortcode allows you to add a category search wherever you want on your website &#8211; page, post or widget area. For example, we added it into a post, and this is how the result looks like:<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"610\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Search-Form-Preview.jpg\" class=\"attachment-full size-full\" alt=\"Search Form Preview\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Search-Form-Preview.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Search-Form-Preview-300x189.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Search-Form-Preview-768x483.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Search-Form-Preview-620x390.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Now, it is important to understand that you can use this newly created shortcode as many times as you find it necessary, and in any area of your website. In case you don\u2019t have experience with shortcodes or don\u2019t feel comfortable using them for any other reason, it might be a good time to learn a bit about <a href=\"https:\/\/qodeinteractive.com\/magazine\/what-are-wordpress-shortcodes\/\">shortcodes in WordPress<\/a>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Every user who uses this search form on your site will only have access to view posts within the selected category.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"542\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Search-Results.jpg\" class=\"attachment-full size-full\" alt=\"Search Results\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Search-Results.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Search-Results-300x168.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Search-Results-768x430.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2021\/08\/Search-Results-620x347.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]This plugin allows you to create multiple category searches. To add more category searches, simply repeat the procedure described above to create new search forms and generate new shortcodes that you will then embed into your WordPress website.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">In Conclusion<\/h2>\n<p>[\/vc_column_text][vc_column_text]Not only does the search by categories make the user experience better, but it also shows that you invest effort into managing your content and making your website user-friendly. Practice shows that<strong> this feature is particularly useful in certain types of sites like e-commerce websites and websites that offer a lot of downloading material.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Since WordPress is generally known for not having a particularly good inbuilt search functionality, maybe you should also <strong>consider adding the general search feature to your WordPress site<\/strong> &#8211; it is easily done with the help of <a href=\"https:\/\/qodeinteractive.com\/magazine\/wordpress-search-plugins\/\">excellent WordPress search plugins<\/a>.[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Adding a &#8220;search by category&#8221; feature to your WordPress site can improve UX, SEO and bounce rates &#8211; learn how to do it in a couple of simple steps. <\/p>\n","protected":false},"author":42889,"featured_media":28295,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[4,13],"class_list":["post-28195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-tips","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/28195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/42889"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=28195"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/28195\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/28295"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=28195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=28195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=28195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}