...

How to Search By Category in WordPress

220

Categories allow website owners to sort their content while making it easier for their users to browse the site. At WPBeginner we use different categories to sort content on our site. For example, when a user arrives on our site, they can go directly to the beginners guide section or WordPress tutorials. Doing so they will be able to skip posts in our other categories. Sometimes you may want your users to be able to search inside a specific category rather than the entire site. In the past, we wrote an article about how to create an advanced search form for custom post types, and a lot of you asked if there was a way to do the same thing for categories. In this article we will show you how to add search by category functionality in your WordPress site. The goal is to add a search box that allows visitors to search inside specific categories.

First thing you need to do is install and activate the Category Wise Search plugin. Upon activation, you need to visit Appearance » Widgets page. There you will notice a new Category Wise Search widget in the list of available widgets. Simply drag and drop the widget to your sidebar and configure the widget options.

Search by Category Widget settings

The widget’s settings allow you to exclude categories from the search box. Leaving exclude categories box empty will will show all your categories in the drop down menu. When you are done simply click on the save button to store your widget settings.

You can now visit your website to see the search by category feature in action.

Search by category feature in action on a WordPress site

Category Wise Search plugin allows you to exclude categories from your search results, but you can also exclude pages from WordPress search results. Remember that this search by category plugin will only be helpful if you are using categories and tags the right way. We hope this article help you improve your site search by adding search by category feature in WordPress. We are curious to know how many of you still use default WordPress search box on your websites? How many of you are using something advanced like custom post type search, search by category, google custom search, Amazon CloudSearch with Lift, etc? Let us know in your comments below.

Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.