Search by Category allows your visitor to select which category they want to search your blog inside of. This allows visitors to find the exact article they're looking for and helps increase viewer loyalty.
Where to Download
How to use
- Download and install the plugin
- Configure the options
- Edit your Theme file to include this code where ever you want the search form:
<?php if(function_exists('sbc')){
sbc();
} else { ?>
...your standard form code here...
<?php } ?>
or if you want to use it in a post or page:
[sbc]
Change Log
1.2
- Included Shortcode: [sbc]
1.1
- Added security fixes
- Removed some excess code
1.0.0
- Default text
- Custom styling
Beta 3
- Search Text
- Exclude Child categories
- search box auto empties and refills if nothing entered
Beta 2
- First complete working version
- Hide Empty
- Focus
- Exclude Categories
Beta 1
- First working version
- Category exclustion from drop-down list isn't functional
Alpha 1
- All functions are present but independent


Share the Love






Hon tap
June 19th
So cool. This is a good feature. Thank you very much.
Duane
June 19th
I think this will really help my readers find things. I use a three column format and the text in the categories box is a bit too long (Categorie is all I can get to show). Is there a way to change that font size? I figure it is pulling it from my template but I thought there might be an over ride I can do by modifying the code of the plugin?
Fire G
June 19th
@Duane: Im sorry to say that SBC was just not meant to be pushed into that small of an area. Even with lowering the font size to it's smallest readable level, the whole word wasn't visible in Firefox and IE.
I suggest copying this CSS into your stylesheet and disable the SBC setting in WP-Admin:
form#sbc-search {clear: both; display: block;}
form#sbc-search * {margin: 0px; display: block;}
form#sbc-search input#s {background: #f5f5f5; border: 1px solid #bbbbbb; padding: 4px 10px; width: 80%; margin: 0px auto 10px;}
form#sbc-search select#cat {background: #fbfbfb url(arrow.png) 88% 50% no-repeat; height: 30px; width: 99%; border: 1px solid #bbbbbb; padding: 4px 20px; -khtml-appearance: none; /* fix default safai styling */ border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px;}
form#sbc-search select#cat option {padding: 2px 4px;}
form#sbc-search input#sbc-submit {height: 30px; width: 40%; margin-top: 10px; border: 1px solid #bbbbbb; float: right; border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px;}
Duane
June 20th
Thanks Fire G for taking the time to respond. I tried this but couldn't find the place the disable SBC setting (although if you meant to uncheck the box 'Use the SBC Form styling', I did that). So the problem persisted. In the process of working in the CSS stylesheet I noticed my sidebar 2 was set at 170px wide, while sidebar one was set at 175px. So, I changed the sidebar 2 width voila, it worked. Now the whole word 'Categories' is visible as well as the little down arrow. That also made the elements at the right side of my page line up better. Thanks!
Germán
June 26th
The link to download is wrong. "http" has two "h" ;)
Flex Guy
June 27th
Great post… good suggestions…thanks!
elmalak
July 3rd
Hi,
I have just downloaded and installed your plugin and I think it's a great one.
I just noticed a bug that I thought would be nice to tell you about.
I installed the plugin into a page and when I search for something it displays the correct results.
However, when there is no result to show it displays" No results found. Try another search"
And below that I get the regular search form and not the Search by Category form!
Is there a way to prevent that from happening?
thanks,
Fire G
July 3rd
Thanks for the kind words.
what you'll need to do is look in your theme's index.php for the search box that you mentioned and just replace that code with the SBC code. You should also do the same with all of your other theme files.
DoZ
July 11th
I think could be nice the ability to select more than one single category...
Don't you?
GadgetGuru
July 20th
Is there search by tags option?
Fire G
July 26th
@GadgetGuru: No since the drop-down would be Gigantic and the default Wordpress search already searches based on category (but orders it based on publish date. There's a plugin to change that already).
John
July 29th
Hi,
Currently I have this plugin displaying on only certain category archives. I'd like to make is so that the default search is to search the current category, and another option is to search all categories.
Can you suggest a way to do this?
Thanks!
Fire G
July 30th
@John, That's actually a great feature I could add in. When the next release goes live (will be soon) you'll be able to do it then.
obseque
August 6th
thank's a lot for your work, it's the plu ing i search... so is there any way to hide category list ? (i use a template page and i don't want the user can search other thing than only one category) ... thank's for your respond
Paul
August 8th
Using WP 2.8.3 and when I use the shortcode on a page the search form forces itself to the top of the page above where I want it to display. Any idea how I can make it show up where I want it?
Also, does this plugin search post/page content, tags, comments... or just titles?
Thanks!
Paul
August 8th
Also, just noticed a couple other bugs.
One, I cannot disable any categories. I click the checkbox and choose save and then the checkbox is blank again. Any ideas?
Two, Disabling the style doesn't seem to change anything.
Once again I'm using 2.8.3 with the default wordpress theme.
Thanks,
If I can get these bugs ironed out it will be perfect!!!
Paul
August 10th
Now this if I try to exclude categories and click save:
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/mylocald/public_html/wp-content/plugins/search-by-category/search-by-category.php on line 107
Ron
August 10th
Great plugin! Its works fine on the front end.
The backend is displaying the same error Paul stated above. It saves the categories to exclude but it cant be altered.
Is there any fix for this?
Thanks.
Fire G
August 11th
Thanks guys, i'll look into it.
Paul
August 11th
Your latest update fixed the error and now it will allow me to select categories to exclude from the dropdown. One more question though, how can I make this plugin include tags in its search?
Thanks, awesome plugin by the way!
Fire G
August 11th
Wordpress search is already configured to search based on tags. All this plugin does is remove results that aren't in the selected category.
Glad you enjoy the plugin.
Paul
August 11th
I created a post and added a tag (my zip code) to it. Then I searched for that zip code and nothing showed up. Is there a setting in wordpress that I don't know about that needs to be set?
Also the [sbc] tag still forces the search form to the to of my post...any ideas how I can make it show up half way down the post where I would like to have it?
Thanks again!
Laurent
August 21st
Hi! Thanks for this plugin. i am using it and it's working fine but I'm searching how to replace the drop-down menu by a list of categories (selection using radio buttons). Anyone who can help on adding this feature? Can we simply modify something in the plugins code? Thanks for your help. Laurent.
Nothing
August 30th
Great plugin! and thanks for this.
but replace the drop-down by check boxes is good.
badcat
September 14th
Is there a way to allow searching of the text used in the Blogroll (Linklist) and Link Categories? Another plugin perhaps or maybe this can be altered?
jeremy
January 13th
thanks for your plugin !
please, how to configure this for search only in title ?
Fire G
January 13th
@Jeremy: You can use the "Search Everything" plugin to customize search results.
jeremy
January 15th
@Fire G: Thanks, but the "Search Eveything" plugin do not allow to search only in title or i did not found this options...
Eddie
January 18th
Hi there,
Would it be possible to have some settings on this plugin where i can search under a parent category(pg) for its child categories(cg).
i.e> Price (pg) to show 1,000-5,000(cg) and 5,000-10,000(cg)
and another one to show something else
i.e> Year (pg) to show 1990-2000(cg) and 2000-2010(cg)
showing at the same time?
In conclusion, making settings to customize the drop down menu's with specific pg and cg's giving [sbc1], [sbc2]...etc
Fire G
January 18th
@Eddie: Neat Idea, I may put it in the next version. But currently, no, there's no way of doing that.
Eddie
January 19th
Would you consider a handsome paypal donation for a working beta version within a week or two? I cant find anything else that does this, and i sure aint sure how to code it, but i gotta deadline in 3 weeks.
Fire G
January 19th
@Eddie: Shoot me an email to 'fireg@fire-studios.com' with your proposition and a clearer explanation of what you want.