The Search Form block is a search bar you place anywhere: a home page hero, a sidebar, a landing page. You choose which fields it carries, what each one is labelled, how wide each one sits, and which page it submits to.
It does not show results itself. Point it at a page holding the Search Results block.
Before you start
Build the results page first, so you have its address for the Results page URL option. Without it the form has nowhere to send the visitor.
Choosing the fields
The fields are a repeating list. Each row has a field, an optional label, an optional placeholder, and a width. Out of the box there are four rows: Location and Type at half width each, then Price and Beds and Baths at a third each.
Widths are shares of one row, offered as full, two thirds, a half, a third and a quarter. Two halves sit side by side, three thirds make a three across row. This is more precise than a fields per row number, which is why this block has widths instead.
Every searchable field is available: the eleven taxonomies, a combined location box, price, beds and baths, living area, lot size, year built, listed after, garage spaces, stories, maximum HOA fee, maximum days on market and subdivision.
The Location field
Location is one box that stands in for four separate lists. A visitor types a city, an area, a county or a ZIP code and the search matches across all of them, plus the full address text, so a street address typed in full also matches.
It is the field to lead with, because visitors do not know or care which of your taxonomies holds the place they are thinking of.
Price, living area, lot size and year built render as dual handle range sliders, and only those four rows offer Slider minimum and Slider maximum. Leave them empty and the slider takes its bounds from your live data. Set them and the slider is pinned to your chosen window, which is how you stop one outlying listing making the price slider unusable.
Appearance options
Title puts a heading above the fields. Left empty there is no heading at all, so one control does the work of a heading plus a show and hide switch.
Hide labels (use placeholders) collapses the form into a compact bar, which is what most hero sections want. This is when the per row placeholder text matters, because it becomes the only prompt the visitor gets.
Button text, Button color, Button size, Button icon and Button width style the submit control. The button width defaults to a third, so out of the box it sits inline as the last cell of a row rather than claiming a row of its own.
As a shortcode
[mlsimport_search_form results_url="https://example.com/property-search/" button_text="Search"]
The field list is a repeating structure and is impractical to express as a shortcode attribute, so the shortcode form uses the default four fields. Use the block or the widget when you want a custom field list.
In the block editor and Elementor
In the block editor, add Search Form and build the field list in the sidebar inspector, adding and dragging rows.
In Elementor, drag Search Form from MLSImport Widgets. The field list is the same repeater on the Content tab, and the Style tab adds typography and colour control over the title, the labels, the inputs and the button.
Four to five fields is the practical maximum for a hero form. Everything else belongs in the refine bar on the results page, where the visitor has already committed and is willing to narrow further.
If it does not work
- Submitting reloads the same page. Results page URL is empty. Set it to the full address of your results page.
- A dropdown has no options. Its taxonomy has no terms, which means no imported listing carries that field. Check the field is ticked on the Select Import fields tab.
- The price slider covers an absurd range. One listing with a bad price is setting the ceiling. Pin the slider with Slider maximum on that row.
- The results ignore a field. The results page’s refine bar overrides on load if it carries a conflicting value. Check the two forms offer compatible fields.
Frequently asked questions
Can I put the form in my theme’s header or a widget area?
Yes. Use the shortcode in a shortcode widget or in a block widget area. It carries its own styles and does not depend on the surrounding template.
Can the form search my regular WordPress posts too?
No. It searches the property index only. Use the standard WordPress search for content.
Why do two of my search fields return different results for what looks like the same place?
Because areas and counties are matched by their term, while cities and ZIP codes are matched by the value stored on the listing. Both are correct, and the combined Location field is the one that spans all of them.
Can I add a field that is not in the list?
Not from the editor. The list is every field the search index holds. A field outside it is stored on the property and can be displayed, but is not searchable.
Related
- The Search Results block
- The Property List block
- Properties, agents and the eleven taxonomies
- The Design Settings page
Send us the form and the search that misbehaved and we will tell you which field is responsible.