The ‘Run WordPress Search’ action initiates a WordPress search. It redirects the web browser to the normal WordPress search results page.
Tip: We recommend enabling the ‘Enable Form Submit on Enter’ setting under ‘Form Processing’ in the ‘Form Settings‘ sidebar. This will enable the user to type a keyword and then type ‘Enter’ to initiate the search.
Demo
Adding This Action
To add a ‘Run WordPress Search’ action:
- When editing your form, click the ‘Actions’ icon at the top of the page. The ‘Actions’ sidebar will open on the right-hand side of the page.
- Click the ‘Add’ icon to add a new action.
- Select ‘Run WordPress Search’ from the Action pulldown. A series of settings will appear.
As with all sidebars in WS Form, click the ‘Save’ button at the bottom to save your changes, or click ‘Cancel’ to disregard your changes.
The ‘Run WordPress Search’ action settings are as follows:
When Should This Action Run?
You can choose to run the WordPress hook when the form is saved, submitted, or both.
Search Query Field
Select the field you would like to use for the search query. The content of that field will be used as the keyword(s) of the WordPress search. We recommend using a Search field.
Filter By Post Types
This feature enables you to limit the search to certain post types. To add a post type:
- Click the ‘Add’ icon to add a new post type.
- Select the post type from the dropdown.
- Repeat this for each post type you wish to filter by.