Formidable Forms

Formidable Forms

  • Features
  • Pricing
  • Resources
    • Docs & Support
    • Blog
    • Community
  • Solutions
    • Web Applications
    • Calculators
    • Surveys
    • Directories
    • Payments
    • Contact forms
  • Login
  • Get Formidable Forms

Formidable Team / Last Updated November 17, 2021

How to Create a Custom Search Form in WordPress

Want to make a WordPress custom search form? This guide shows you all the ways to create advanced search forms in WordPress.

how to create a custom search form in WordPress
Approximate read-time: 5 minutes

Hoping to create a custom WordPress search form for your website? Let's get that done! This guide shows you in WordPress how to add search forms. If you want to add a search box to your site, read on.

Here's what we'll cover:

  • How to add the WordPress default search form to your site
  • Creating a custom search form (with a WordPress form builder)

How to add the WordPress default search form to your site

By default in the WordPress core build, there is a search form ready to go. To insert it, you need to use the following code:

Formidable Forms is the best WordPress Form Builder plugin. Get it for free!

get_search_form()

The above code will search for the searchform.php file in the WordPress theme you have active. If your theme doesn't have one, it will use the default WordPress form.

If you know how to code, you can try creating a search form manually. You just need to edit your searchform.php file. But if you want to save loads of time, one of the other solutions in this guide might be a better fit.

The default search form in WordPress has one more issue to be aware of. The search results displayed are from a global site search. That means the results show everything on your site! In many cases, you'll need a custom search form to drill deeper.

Does your WordPress theme include a search form?

It's possible that your WordPress theme includes a search form by default. Usually, you can find search form settings by looking into your theme options. These are located in the backend of your WordPress site.

If you can't find anything about search forms in your WordPress admin, it's still possible your theme has a shortcode that you can use to display your search form. Check out your theme's documentation or website to see if you can find out more.

beaver builder

And there's still one more possibility to rule out before we proceed. If you are using a page builder like Elementor or Beaver Builder, there might be a module you can use to insert a search form. Have a look!

Can I just use a search plugin?

WordPress plugin directory

Take a look at the WordPress.org plugin directory. Use their search engine and you'll quickly learn there are a ton of search plugins. While some of these can work well, just remember that having too many plugins on your WordPress site can slow things down.

Another issue with search plugins is that they don't always play well with all types of data. There's a lot that can go wrong when you are trying to get plugins, themes, and all your data to work together.

Having said that, if you are looking for a toolset that lets you search specific pages or custom post types, then a search plugin could be a working solution for you.

Creating a custom search form in WordPress

Still here? Want to learn how to add search forms in WordPress the easy way? Let's get to it!

To do this, we'll need some tech-savvy, but nothing like expert coding skills. Even if you are a pro developer, you can still save tons of time with this solution. If that sounds good, let's learn how to give WordPress an advanced search form.

What do you need to get started?

Formidable Forms plugin

To build a custom search form that can give you a ton of control, you'll need a WordPress plugin. But it's not a dedicated search plugin. It's a form builder plugin!

Formidable Forms has a search form template that does the same thing as the default WordPress search feature (adds ?s=[25] in the redirect URL). This can be adjusted to only search a single post type:

?s=[25]&post_type=page

This can be adjusted even more too. Just swap in the WordPress parameters like 'post', 'p', 'date', 'year', 'month', and 'name'!

So of course, a form builder plugin has all the things you need to make search queries come to life. But it can get even more custom than that. For starters, you don't need to stick to a traditional search box. An advanced search can consider a few different data points, like the example below:

Advanced WordPress Search Forms

How do you create your custom search form?

We've created an entire tutorial here to get you started quickly. Working through that should help you see how you can create custom search forms for an unlimited set of scenarios.

In this article, we'll give a crash course though. This setup is dependent on the Formidable Views feature. If you want to create powerful stuff without all the work, Views will change your life! Here's what you need to create your custom search form:

  • A data form (which has the stuff you want to be searchable)
  • The results view (that displays the search results)
  • A results page (that the user goes to after submitting their search)

Setting this is up isn't as hard as it might seem. For example, redirecting to another page using Formidable is easy:

Advanced Search Redirect URL

Then we use some shortcodes to add more customizations. No extra HTML or CSS required here!

Advanced Search URl W/Params

After that, we'll set up our custom fields to filter correctly. To get this WordPress search form filter going, just adjust the dropdowns and you're set.

Advanced Settings

And actually, if you want, you can display the search form and the search results all on the same page. See the example below:

Advanced Search Forms Gif

Your search form can function in a variety of ways too. Want to accept partial form submissions? You can do that too! Take a look:

Advanced Search Show View Submit

The last thing you might consider? Making sure your search form matches your site. With Formidable, you can tweak how your search field looks using our visual styler.

WordPress Visual Form Styler

Wrapping up

With a search form setup like the above, it's not hard to see how anything can be made searchable. Do you use WooCommerce? Wouldn't it be nice if all your products could be searched based on several different variables? You can do that too.

We hope you've found this information helpful. Please come back to the Formidable blog for more tips. We'll see you soon!

Read more about WordPress search forms

  • best WordPress search plugins 7 Best WordPress Search Plugins
    Read More
    searchable database plugin for WordPress The Best Relational Database Plugin for WordPress
    Read More
    how to create a searchable database in WordPress How to Create a Searchable Database on a WordPress Site
    Read More

Formidable Forms can be used to create ANY form you can imagine. Take advantage of our 14-day money-back guarantee and get Formidable Forms now!

Using WordPress and want to get Formidable Forms for free?

Get Formidable Forms Lite Now

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

Comments

  1. Nawin says

    July 29, 2021 at 9:37 pm

    Fair enough

    Reply
  2. Andy Globe says

    December 28, 2021 at 6:10 am

    Thanks for the tut.
    Always learn something when I come over.
    Appreciate you taking the time.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get Email Updates

Popular Resources

    • How to Create a Searchable Database on a WordPress Site
    • Create a WordPress Custom Calculator: Easy, Powerful Results
    • How to Create a Fitness Tracker in WordPress
    • Formidable Views: The Best WordPress Custom Application Plugin
    • How To Require Email To Download Files in WordPress
    • How to Create Conditional Drop Down Lists in WordPress Forms
    • Best Gravity Forms Alternative for WordPress: Formidable Forms vs. Gravity Forms
    • How to Make a Quiz in WordPress
    • WPForms Alternative: Formidable Forms vs. WPForms Compared

Take on bigger projects Right Now

Get the tools you need to revolutionize your workflow and architect a masterpiece. Build the most advanced WordPress forms and actually use the data you collect in meaningful ways.

Get the most advanced WordPress form plugin and the only form builder with integrated Views.

Get Formidable Forms Now

Resources

  • Community
  • Affiliates
  • Contact
  • Free Online Form Builder

Top Features

  • Application Builder
  • Calculator Forms
  • Surveys & Polls
  • Quiz Maker
  • Form Templates
  • Application Templates
  • Directories
  • Donation Plugin

Company

  • About Us
  • Giving Back
  • Careers
  • Newsletter
  • WP Tasty
  • Nutrifox

Copyright © 2023 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.
Privacy Policy | Terms of Service | Sitemap

Join 300,000+ using Formidable Forms to create form-focused solutions fast. Get Started See User Reviews