WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Plugins» How to Search By Category in WordPress

How to Search By Category in WordPress

Last updated on May 8th, 2015 by Editorial Staff
30 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Search By Category in WordPress

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.

30 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

18 Comments

Leave a Reply
  1. Hansan says:
    Nov 14, 2016 at 3:09 am

    Hey help , I want to create a search box for web page and it should search in only one page category. How can i do that in wordpress.

    Reply
  2. Eric Thomas says:
    Jun 27, 2014 at 1:22 am

    This is exactly what I was looking for! Needed a sidebar for a separate review section, with a search bar that only searched that separate section. So this was perfect

    Reply
  3. philips says:
    Feb 25, 2014 at 3:19 am

    Thanks for the support for this awesome plugin. i have tried the plugin, the search by name works fine but the category search is not showing any result. i guess it is not compatible with 3.5 — >3.8.
    i have tried changing “cat” to “category” but all to no avail . Any quick help will be hugely appreciated. Thanks in advance.

    Reply
  4. Eric says:
    Oct 17, 2013 at 4:19 am

    After I installed this plugin, the original categories widget doesn’t work any more!
    Once I removed the plugin, it’s work again!
    I still can’t find the reason.

    Could someone tell me how to fix the problem?

    Thanks a lot!

    Reply
  5. sergio says:
    Sep 9, 2013 at 12:11 pm

    i run both regular search with google custom search, and the search category plugin, . i modified the searchform.php in order to have google search results ( with this shortcode ).
    When i use the search by category plugin the results are the same of the standard so they are not filtered obviously because i use in both case google custom search .
    so i would reset thestandard only for () for this plugin
    how can i Do?
    thanks

    Reply
    • WPBeginner Support says:
      Sep 9, 2013 at 10:39 pm

      you can not use search by category and Google custom search. You can create two different forms and search templates.

      Reply
  6. Srinivas says:
    Sep 3, 2013 at 4:42 am

    Team,

    I tried the steps above, but when i added [sbc] in the text area, it just displayed that as a text instead of calling the search box. Am i missing something here.

    Else, also not sure where i can add the mentioned code in the theme template. Could someone help me with the specific theme file i need to edit.

    Thanks

    Reply
    • Editorial Staff says:
      Sep 3, 2013 at 3:10 pm

      Please post all plugin related support in the supports forum:

      http://wordpress.org/support/plugin/search-by-category

      Reply
  7. Gretchen Louise says:
    Aug 23, 2013 at 11:02 am

    Oh I’m so glad to find this plugin! I think I need to keep looking though because I need to have it search specific pages on my site as well as some categories of posts.

    Reply
  8. mike says:
    Jun 19, 2013 at 8:41 am

    Really saved my time a lot ………..

    This plugin still works with wordpress 3.5.1 !!!!

    Reply
  9. Rosca Bogdan says:
    May 17, 2013 at 3:34 am

    @Alian there is a plugin for that, Query multiple taxonomies.
    You can find it @ http://scribu.net/wordpress/query-multiple-taxonomies/ . I use it and it`s working like a charm.

    Reply
    • Alan says:
      May 23, 2013 at 8:58 pm

      Can this be used for search results?

      Reply
  10. Gitte Hansen says:
    May 1, 2013 at 12:35 pm

    Search by category is only tested for WordPress version up to 3.4.2 – is it ok to install anyway? I use 3.5.0
    I really look forward to a functionality which will make it easier for my readers to browse and seach in my categories.
    Greetings Gitte

    Reply
    • Editorial Staff says:
      May 6, 2013 at 10:30 am

      Yes it is fine. It will work.

      Reply
  11. Corrinda says:
    Apr 30, 2013 at 9:51 am

    I just did a review of different options for a client site and eventually installed the Search Everything plugin. It gives you the option to also configure what gets searched. And in this case I wanted to exclude a couple of categories.

    Reply
  12. Azim says:
    Apr 30, 2013 at 9:40 am

    If no serious customization is needed, you could just use the following snippet in your searchform.php

    <form method="get" id="searchform" action="<?php echo home_url(); ?>">
    <input type="search" id="s" name="s" />
    <?php wp_dropdown_categories( 'show_option_all=All Categories' ); ?>
    </form>

    Reply
    • Pam says:
      Dec 29, 2013 at 11:26 am

      What would this do for you? tried it but nothing.

      Reply
  13. Alan says:
    Apr 30, 2013 at 9:18 am

    I use Relevanssi on one of my sites and it is great but I would love to add something like this to narrow search fields but rather than narrow by category. I’d like to narrow by custom taxonomy.

    Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
All in One SEO logo
All in One SEO
Improve website SEO rankings with AIOSEO plugin. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2020 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2020)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2020)
    • SiteGround Reviews from 4196 Users & Our Experts (2020)
    • Bluehost Review from Real Users + Performance Stats (2020)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2020 – Step by Step Guide
Deals & Coupons (view all)
HostGator
HostGator Coupon
Get 62% OFF HostGator, one of the most reliable and popular web hosting companies! Includes FREE domain.
SeedProd Logo
SeedProd Coupon
Get 50% OFF SeedProd Coming Soon Page plugin for WordPress.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).
Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress CDN by MaxCDN | WordPress Security by Sucuri.