Are you trying to add search by category in WordPress sites?
Most WordPress site owners don’t realize how confusing their search results look until they try to add search by category in WordPress.
A visitor types “chicken” into a cooking blog’s search bar and gets dinner recipes mixed with kitchen gadget reviews, nutrition guides, and old posts, all from completely different categories.
We’ve seen this firsthand with content-heavy sites across every niche. WordPress’s built-in search doesn’t natively let visitors filter results by category, so every keyword search returns everything on the site at once with no way to narrow things down.
In this article, we’ll show you how to add search by category in WordPress using SearchWP.
Why Add Search By Category In Your WordPress Site?
Category search is a search form that includes a category dropdown, letting visitors type a keyword and choose which section of your site to search at the same time. When someone selects “Recipes” and searches “chicken,” they only see posts from that category, not your gear reviews or newsletter archive.
We know from experience that this feature makes a real difference across every type of site. Here are the pain points it solves:
- Overwhelming search results: When visitors search on a content-heavy site, they often get dozens of off-topic posts for any keyword. Without a category filter, there’s no way to separate your beginner guides from your advanced tutorials, or your product posts from your editorial content.
- No built-in filter in WordPress: WordPress’s default search doesn’t natively support category filtering without custom code. Every blog, store, and membership site hits this wall the moment they grow beyond a handful of posts.
- Missed sales on eCommerce sites: Shoppers on a WooCommerce store can’t filter search to “Electronics” or “Sale Items,” so they browse less and convert less. We’ve watched visitors abandon a search entirely when they couldn’t find similar products grouped.
- Lost readers on blogs and eLearning sites: A beginner looking for introductory content on a site with years of advanced posts will leave frustrated if they can’t filter to the right category. That’s a loyal reader lost over something that takes minutes to fix.
That said, let’s look at how you can add a category search in WordPress.
Add Search By Category In WordPress (For Beginners)
SearchWP is the easiest way to add a category search form to WordPress without touching any code.

SearchWP is the best WordPress search plugin. It replaces WordPress’s default search with a powerful, customizable engine that gives you full control over what your visitors find and how they find it.
Here’s why site owners use SearchWP to add category search:
- Category Search forms. SearchWP’s built-in Category Search layout theme adds a category dropdown to any search form, letting visitors filter results to a specific category with no coding required.
- Relevance-ranked results. SearchWP’s engine indexes your content and returns the most relevant results first, not just the newest. Visitors find what they’re actually looking for instead of scrolling through off-topic posts.
- Lightning-fast live search. Install the Live Ajax Search extension (included with Standard and up) to show results in a dropdown as visitors type, with no page reload required.
- Full customization. Control which categories appear in the dropdown, choose which engine powers the results, and style the form to match your site’s design.
With that, let’s see how you can use SearchWP to add search by category in WordPress.
Step 1: Install and Activate SearchWP
To get started, you can visit the SearchWP website and sign up for an account. After that, go ahead and log in and head to the Downloads tab in your account dashboard.
From there, click Download SearchWP to save the ZIP file to your computer. Make sure to also copy your license key, as you’ll need it during setup.

Next, you can install and activate SearchWP on your WordPress site. If you’ve never installed a plugin before, you can follow this WordPress plugin installation guide for step-by-step instructions.
Once the plugin is active, go ahead and click Start Onboarding Wizard and follow the onscreen instructions to configure SearchWP for your site.

SearchWP is all set and ready to build your first category search form!
Step 2: Customize Your WordPress Search Algorithm (Optional)
SearchWP automatically starts indexing the content on your site upon activation. However, you can take complete control over the search engine.
Note: This step is optional. SearchWP’s default engine works with the Category Search form without any manual changes here.
To customize the algorithm manually, you can visit SearchWP » Algorithm from your WordPress dashboard.

The default configuration indexes Posts, Pages, and Media files. You can choose which sources you’d like by clicking on the Sources & Settings button.
Bonus tip: you can use dedicated Engines for different types of content (or conditions) by leveraging the Supplemental Engines.

A new popup window will now open with the default sources for the search engine.
Then, select the sources you’d like to make searchable. Once that’s finished, click “Done” to apply changes.

You can also determine how much each attribute contributes by adjusting the Applicable Attribute Relevance.
Simply move the slider next to each attribute to adjust the weight. Sliding it to the right increases its importance in search results while sliding it to the left reduces its impact. This helps you fine-tune how search results are prioritized on your site.

If you wish to ignore any attribute, you can simply do that by clicking on the Add/Remove Attributes button.
A new window will popup where you can uncheck the ones you’d like to remove, and click ‘Done’ to update the settings.

When you are satisfied with the configuration, click “Save” to apply the changes.
Your Engine setup is now complete.

The index rebuilds periodically to stay up to date with the changes.
However, if you see a notice that says, “The index needs to be rebuilt,” you should click the Rebuild Index button to force a full manual index rebuild.

Step 3: Create A Search By Category Form In WordPress
Next, you can head to Search » Search Forms from your WordPress dashboard.
From there, go ahead and click Add New to start building your category search form.

Give your form a descriptive name like “Search by Category” to keep things organized.
After that, you’ll see a Choose a theme section with five layout options. Go ahead and select Category Search from the list.

Next, make sure the correct Engine is selected.
If you have created multiple search engines, it’ll show in the dropdown. m

Under Results Page, choose either Default (your theme’s normal search results page) or SearchWP (SearchWP’s own results template).
The benefit of choosing SearchWP is that you’ll be able to make advanced changes to the Search Results page

Now, add the types of content you want to search for in the “Type of search” field.
The sources you selected in the Algorithm (from the previous step) will appear here.

From there, use the Select Category field to choose which categories appear in the dropdown on your site. You can include all categories or pick specific ones to keep the dropdown focused.
This is the most critical part of this tutorial; you need to select categories that you want to include in the search by category form in the “Select Category.” Only the ones you pick will appear in the dropdown.
Please note: you will only see categories that are currently in use. If a category is not listed, it typically means there is no content associated with it.

When you’re done, scroll to the top of the page.
From here, you can click the Save button.

Step 4: Add the Form to Your Site
There are multiple ways to add the search by category form on your website.
Go ahead and click the Embed button next to Save to see all options.

In the popup modal, you’ll see multiple ways to add the search by category form to your website.
You can choose from a Gutenberg Block, Shortcode, or PHP Code. Follow the one that suits you best.

Let’s see an example of how you can add a search by category form in WordPress using the Gutenberg Block.
Open the page where you want to add the search form in the WordPress content editor. From there, click the + button and search for the SearchWP Form block.
From the block’s settings panel, choose the category search form you created from the dropdown. After that, go ahead and publish or update the page, and your form is now live.

Note: You can also embed the form using a shortcode. Each saved form in Search » Search Forms includes a shortcode option you can paste into any page, post, or widget area.
Simply choose the search form you just created using SearchWP.

Finally, you can click “Publish/Update”, depending on your scenario, and that’s it!

Open the published page to start using your search by category form in WordPress!

Bonus: Add Live Search to Your Category Form
Once your category search form is live, a great next step is adding live search so results appear as visitors type.
The Live Ajax Search extension (included with Standard and up) works alongside your category form and displays a results dropdown in real time with no page reload needed.

To learn how to set it up, check out our guide on how to add live search to WordPress for free.
FAQs for Category Search in WordPress
1. Does WordPress search by category by default?
No, WordPress’s built-in search doesn’t natively let visitors filter results by category. The default search form searches across all post titles, excerpts, and content at once with no category filter included. Adding a category search form with a plugin like SearchWP is the easiest way to give visitors that control without any coding.
2. How do I add a category filter to my WordPress search form?
The easiest way is to use SearchWP’s built-in Category Search layout theme. After installing SearchWP, head to Search » Search Forms, click Add New, and select the Category Search theme. From there, use the Select Category field in the Custom Styling panel to choose which categories appear in the dropdown, then save and add the form to any page using the SearchWP Form block.
3. Can I choose which categories appear in the SearchWP dropdown?
Yes. When you select the Category Search theme in the form editor, the Custom Styling panel includes a Select Category field where you can pick exactly which categories appear in the dropdown. We’ve found this especially useful for sites that want to hide internal or uncategorized posts from the filter.
4. Does SearchWP’s category search work with WooCommerce products?
Yes, SearchWP’s category search form works with WooCommerce product categories in the dropdown. From our experience, you’ll want to make sure your WooCommerce products are enabled as a source in SearchWP » Algorithm, so they appear in results. For deeper WooCommerce search features including product variations and SKUs, SearchWP’s WooCommerce extension (Pro and up) adds more advanced product search capabilities.
5. Do I need to know how to code to add category search to WordPress?
No coding is required. SearchWP’s Category Search layout theme handles the entire setup through the WordPress dashboard with no changes needed to your theme files or functions.php. From our experience, most site owners have a category search form live in under 10 minutes.
What’s Next…
You’ve now added search by category to your WordPress site using SearchWP’s built-in Category Search form. Visitors can narrow their search to any category with a category dropdown, with no custom code needed.
You may also want to see our guides on how to create a custom search form in WordPress and ways to improve WordPress search.
Ready to add search by category to your site? You can get started with SearchWP here.


