Advanced search forms are something almost every large site wants, especially since they make it dramatically easier to find content across the site. This is a simple plugin that provides a short code that displays an advanced search form on your site. The search form includes the options to search in any and all post types, tags, categories, and any custom taxonomy. As a short code, it’s extremely simple to setup and you can have an advanced search form added to your site in less than five minutes.
One of the great things about this plugin is that it allows you to add an advanced search form to your site, but without modifying any of your existing functionality. Still want a simple search form? No problem.
The search form is placed on any page with the following short code:
[advanced_search]
By default, the form will include options to search in categories, tags and all public post types, including both posts and pages. Categories and tags will both be outputted as radio options.
The short code accepts several parameters:
- categories=”1″
- tags=”1″
- post_types=”1″
- excluded_post_types=NULL
- taxonomies=NULL
- style=”radio”
- search_text=”Key Words”
- placeholder=”Enter search terms”
- search_type_text=”Search by Type”
- search_cat_text=”Search by Category”
- search_tag_text=”Search by Tag”
- search_tax_text=”Search by %s”
- search_text=”Search
- url=”http://yoursite.com”
If you wish to disable the categories, tags, or post types, simply set their parameter to 0, like this:
[advanced_search categories=1 tags=0]
By default, setting post_types to 1 enables all public post types, but since you may not want users to have the option to search in some particular post types, you can simply pass the name of post types to exclude to excluded_post_types, like so:
[advanced_search categories=1 tags=0 excluded_post_types="books,movies"]
With excluded_post_types=”books,movies” neither books nor movies will be available as post types to search in.
You can also enable options to search in any custom taxonomy as well by passing the names of the taxonomies to the taxonomies parameter, like this:
[advanced_search categories=1 tags=0 taxonomies="genres,topics"]
With taxonomies=”genres,topics”, both the Genres and Topics taxonomies will be available as options.
The final parameter, style, lets you define whether the categories, tags, and taxonomies should be shown as radio or select options. To show them as select menus, simply use the short code like this:
[advanced_search categories=1 tags=0 style="select"]
Version 1.1
Added new parameters to change the titles of each section.
Added a new “url” parameter.
Added a new parameter for changing the search button text.
Added a new parameter for changing the placeholder text in the key words input.
Version 1.0
Initial release.
As a premium subscriber, the plugin is free to download and use as much as you wish.
Already a premium subscriber? Login below to download this plugin for free






Hi Pippin,
(I’ve just found your website after finding your plugin on CodeCanyon.)
I thought I’d explore what else you had to offer and after reading about this post noticed this message:
Not a subscriber? Signup today and get immediate access to this plugin and more.
However there is no link to Signup? You might want to make it a link as now I have to search around to see how to signup.
Whoops! Thanks for the heads up!
Hi!
Very nice plugin, I want to buy it but I have one question :
I’ve created 4 portfolios custom post types like : Villas, Luxury Villas, Apartments, Seaview Apartments
What I want to have in the search is :
“Property type” – a drop-down list with “with all these ” villas, luxury villas… ”
” Beds” – a drop-down list with ” 2 beds, 3 beds, 4 beds” this will be tags form the custom portfolio posts.
Is this possible? If so I will buy it.
Thank you !
How are the Property Types populated? Is it a taxonomy?
I think it is a taxonomy because I can create unlimited portfolios like ” Luxury house ” and there put all the posts related to it and so on …
You will need to find out for sure before I can help you with it, sorry.
I don;t know exactly if there are custom post types or custom taxonomies, can you tell me how can I check this quckly ?
Thank you!
P.S: I’ve tried to buy this plugin with paypal but is not working :
This payment cannot be completed and your account has not been charged. Please contact your merchant for more information.
Do you see a transaction in your PayPal account?
This is the code :
$portfolio_slugs = get_option("zeitgeist_portfolio_slug");
if(is_array($portfolio_slugs))
foreach ( $portfolio_slugs as $slug ){
add_action('init', 'create_portfolio');
register_taxonomy("category_".$slug, array($slug), array("hierarchical" => true, "label" => "$slug Categories", "singular_label" => "$slug Category", "rewrite" => true));
function create_portfolio() {
$portfolio_slugs = get_option("zeitgeist_portfolio_slug");
$portfolio_counter = 0;
$portfolio_names = get_option("zeitgeist_portfolio_name");
foreach ( $portfolio_slugs as $slug ){
$portfolio_args = array(
'label' => __("Portfolio '".$portfolio_names[$portfolio_counter]."'"),
'singular_label' => __($portfolio_names[$portfolio_counter++]),
'public' => true,
'show_ui' => true,
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => array('slug' => $slug, 'with_front' => true),
'supports' => array('title', 'editor', 'thumbnail', 'author', 'comments', 'excerpt')
);
register_post_type($slug,$portfolio_args);
}
}
function portfolioSingleRedirect(){
global $wp_query;
$queryptype = $wp_query->query_vars["post_type"];
$portfolio_slugs = get_option("zeitgeist_portfolio_slug");
if(is_array($portfolio_slugs))
foreach ( $portfolio_slugs as $slug ){
if ($queryptype == $slug){
if (have_posts()){
global $pcat;
$pcat = "category_".$slug;
require(TEMPLATEPATH . '/single_portfolio.php');
die();
}else{
$wp_query->is_404 = true;
}
}
}
}
add_action("template_redirect", 'portfolioSingleRedirect');
[/code]
In the dashboard I'm allowed to add unlimited portfolios and in each one I can create posts and I can also assing categories for each portfolio created.
If you want I can give you acces to dashboard to take a look.
Thank you!
Those are both custom post types.
Hi Pippin
i would like to use your plugin “avanced search” for searching in my “custom fields” (i have created custom fields with advanced custom fields plugin)
it’ s possible to add this type of filtering in the search form?
thank you very much!!!
marco
It does not search custom fields, sorry.
Hi Pippin -
I’m having trouble getting the search_text parameter to work. I’m trying it just as suggested above. Any thoughts?
Thanks,
Patrick
Can you show me the exact short code you’re using?
It seems to be working now with my current shortcode: [advanced_search categories=0 tags=0 post_types=0 taxonomies="legalservices,practiceareas" style="select" search_text="Search"]
Is there a way to hide the Search headline while still showing the search_text in the button? For instance, if use “Add Keywords” as my search_text, it appears as both the heading above the search bar and as the button text. Or is there some way to have different terms in each?
Thanks.
You could hide it with CSS, but that’s the only way.
any plans for a widget?
No, sorry.
OK. Will the shortcode work inside a widget?
Yes, though sometimes it requires a minor code snippet be added to your theme.
I can’t seem to produce any results with the “Any” selection. When I just click search, with Any as the default choice, the page just reloads. Any thoughts? I’m still testing with my site and don’t have all the terms filled with posts yet, in case that helps.
Thanks.
PH
You have to enter at least one search term.
Hi Pippin,
This is probably a no-brainer for more advanced users, but…
Can I insert this into a template?
If so – what is the php code for doing so?
Thank you!
Yes you can!
Hi Pippin
How I can make to the advance search form, when don´t have result for show, display some message?
Thank you.
Are you familiar with how to modify template files?
Love the idea behind this! Likely going to need this for a future project.
You should totally incorporate custom fields either in this or another plugin. There is one custom fields search plugin I know of: http://wordpress.org/extend/plugins/wp-custom-fields-search/ & it has bugs (hasn’t been updated in 2 years).
If you could create a custom field search solution (great for real estate, dealerships, directories, online stores etc.), I think it would be really popular. Has that ever piqued your interest?
You can ignore that last comment. Just saw an old comment where you said you’d like to at some point. For now, I’ll try to use more taxonomies instead of fields.
Is it possible to exclude Posts and Pages from Advanced Search?
I tried using: [advanced_search excluded_post_types="Posts,Pages"]
but it’s still returning results from pages and posts.
Change that to:
I tried that exact thing a few minutes after posting and it didn’t work. I just tried again now to verify that I wasn’t crazy.
Here’s the exact code I’m using. Let me know if anything jumps out at you as suspicious:
echo do_shortcode( ‘[advanced_search categories=0 tags=0 post_types=0 excluded_post_types="post,page"]‘ );
News from the “right tool for the job” dept. I installed “Advanced Search Widget” rather than try to wrangle this shortcode into a task it was not meant to do. All is well. Thank you.
Ok!
Hi,
I’m looking for this on code canyon and I can’t seem to see which one it is under. Could you shed some light on this for me?
This plugin has never been on Code Canyon. You can purchase it from this page.
Is there a way for this plugin to support nested Taxonomies? I’m doing a site that has the State and City defined via taxonomies and I’ve had a hell of a time finding support for an advanced search form that would allow me to sort through custom post type’s which define the vehicle type, then State and Cities defined in Taxonomies.
If it would this plugin would be the bee’s knees.
Nested in what way?
Ideally for me there would be the ability to first select the Parent Taxonomy in a separate select box, then the child taxonomy in a separate select box which is populated only with terms matching the parent select box.
I.E.
State – Parent Taxonomy
California
Nevada
Cities – Child Taxonomy
Los Angeles
Sacramento
San Francisco
Sorry for the slow reply, but no, that isn’t possible.
I appreciate your time and effort, luckily I found something a little closer to what I was looking for. If anyone else is looking for a similar solution WP-Types.com sells a complete toolset with Parametric search functionality built in.
One more thing if anyone else is looking, there’s a plugin called AJAX Chained Selects that also can add Chained Select Boxes like I wanted for Categories, and Taxonomies, but unfortunately doesn’t support custom post types.
Wondering how to exclude everything but the custom post types I’m wanting to search (including removing the “Any” option). I have this below but can’t seem to exclude the “Any” radio button:
[advanced_search excluded_post_types="post,page,forum,attachment,topic,reply" categories=0 tags=0 taxonomies="locations,programs" style="select" search_tax_text="Choose %s" search_text="Search"]
At this time, the Any option can only be excluded by hiding it with CSS.
is there a way to get posts from different site on network?
(WordPress Multi Sites)
This download link is also busted for me
I’ve just fixed it as well. Something happened on my host over the weekend and a large number of files disappeared. If you encounter any others, give it a few minutes and try again. I’m going through all of them right now.
Thx, Pippin!
Hi
I need a search box with radio buttons to allow users to search by normal text or tags. Can you plugin do this?
Thanks.
No, sorry.
Hi Pippin
please let me know if this advanced search plugin will fit my needs
see here:
http://wordpress.stackexchange.com/questions/99119/advanced-wordpress-search-with-drop-down-menus
if it does I will go ahead and purchase it. I am just not sure if the option of having 2 drop sown menus exists.
Thanks
Gil
As long as both drop downs are taxonomies or post types, yes you can!