SearchWP Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP’s many hooks

Search Forms

SearchWP simplifies the process of adding custom search forms to your website, removing the need for coding skills. There’s no need to alter theme files or use additional plugins for search functionality — SearchWP’s Search Form feature has you covered. You can design search forms with various layouts and customize them by choosing different engines and templates for your search results.

Embedding these search forms into your website is easy and can be done on any page or template using Gutenberg blocks, shortcodes, or PHP code, making it a straightforward solution for improving your website’s search capabilities.

Create a New Search Form

To get started with Search Forms, navigate to the Search > Search Form page and select “Add New” to initiate a new search form.

On the next page, various customization options for the Search Form will be available to you. The options are divided in 2 sections: “Choose a theme” and “Custom Styling”.

Choose a theme

In this section, you can switch between the different layouts of the search form. For each selected layout, you can also preview how it will display on the front end of your site.

Layout Theme: Select a layout theme for your Search Form from a variety of predefined settings, which you can customize to fit your needs. Below are the available form themes:

  1. Basic: A simple form with a search button without any filter options.
  2. Category Search: This form includes a search button along with a category filter, allowing users to refine their search results based on the selected category.
  3. Quick Search: Offers a search form that displays a list of popular search terms which provides users with faster access to their search results.
  4. Advanced Search: This layout introduces a toggle for additional filtering options such as Authors, Post Types, and Tags, helping users narrow down the search results based on dropdown values.
  5. Combined: This option allows the creation of a custom search form using any combination of the options present in the Custom Styling section.

Custom Styling

This section offers a variety of functional and design choices that allow you to tailor the search form to meet your specific needs.

Category Search: When activated, this feature displays a select dropdown for Post Categories, enabling users to filter search results by a chosen category term. By default, WordPress categorizes only Posts, but there are plugins that add categories to Pages and other post types as well. Category Search filter works with all of those. You can add or remove the terms for the filter dropdown from the Select Category field.

Quick Search: This feature allows for the addition of multiple quick search terms, designed to redirect users directly to their search results page. These terms should be inputted into the Quick Search Items field within the Search Form. For security reasons, the system requires that these items be manually inputted into the Quick Search Items field.

Advanced Search: This feature enables you to refine your search results by Authors, Post Types, and Tags. Initially, all filter options are included. However, you can easily choose which filters to use or not use by adjusting the selections in the Advanced Search Filters field.

Engine: Here, you can select the search engine to be used by the Search Form. This selection is based on the engines you’ve set up in the Engine settings page. The Default engine is selected automatically, but you have the option to switch to a supplemental engine if one is available.

Results Page: Choose between using the Default template or the SearchWP template for displaying your search results. The Default template uses the search template from your current theme, while the SearchWP template offers a customized option created by the SearchWP plugin. You can change the styling of the SearchWP template from the Template options page.

Note: If you select a supplemental engine, then you will need to use the SearchWP template to display search results.

Type of Search: Here, you can choose which types of posts to include in your search. The available options depend on the engine you’ve selected. If you don’t specify anything, the search will cover all post types. This feature is quite useful, allowing you to tailor multiple search forms to different types of content using the same engine.

Select Category: This allows you to manage which categories appear in the category filter dropdown. Turning on the category filter for the first time automatically includes all categories. If you remove all categories from this field, the category filter will disappear from the search form on your website.

Field Label: Use this area to set the placeholder text for the search form. If left blank, the form will not show any placeholder text.

Search Button: This switch lets you decide whether to show or hide the search button on your form.

Quick Search Items: Here, you can input terms for the quick search feature. New forms have the quick search items already pre-populated with the top 10 most searched terms. When you place the cursor in the field, it will suggest additional terms based on your site search statistics. You can modify your desired search phrases or keywords and then press enter.

Advanced Search Filter/s: In this option, you can add or remove filters for authors, post types, and tags to refine your advanced search options. The authors dropdown will list all authors of WordPress Posts. Selecting a post type will limit the options to those you’ve included in the Type of Search field. The tags dropdown will show tag terms associated with Posts.

Form Style: Here, you can customize how your search form looks. You can adjust things like the form’s border style, border color, and the size of the text within the search form.

Button Style: This section allows you to tweak the appearance of the search button. This includes updating the button label text, background color, font color, and font size

Embed a Search Form

SearchWP offers three methods to integrate a search form into any page on your website:

Gutenberg Block: When editing a post or page, look for the “SearchWP” block to insert a Search Form block directly into your content.

Shortcode: Simply copy and paste the provided shortcode into any post or page to embed the Search Form where you want it to appear.

PHP code: Insert the PHP code into your theme’s post template or a code snippet to display the customized Search Form on your site.

Embed Terms: You can easily add a Search Form block to an existing page by choosing it from the dropdown menu, or you can opt to create a new page specifically for the block.

Create a Better WordPress Search Experience Today

Never lose visitors to unhelpful search results again. SearchWP makes creating your own smart WordPress search fast and easy.

Get SearchWP Now
Multiple Search Engines Icon