web_search_gateway Shortcode

Render a native GET form using the current fields of an enabled Faceted Search context. Visitors submit to another results page; the source page does not start the interactive search engine.

Usage

[web_search_gateway context="catalog" target_url="/results/#results" button_text="Search"]

Enable Faceted Search and configure the context before using the form. Both the context and destination must be available. The Gutenberg equivalent is Search Gateway.

Attributes

Attribute Default Accepted values and purpose
context Empty Required enabled context ID.
destination_mode url url or wordpress_archive.
target_url Empty Relative path or absolute HTTP(S) destination. Credentials and executable schemes are rejected.
archive_type post_type post_type, taxonomy, or shop.
archive_post_type Empty Public post type with an archive.
archive_taxonomy Empty Public taxonomy for the term destination.
archive_term Empty Term ID belonging to that taxonomy.
fields Empty Ordered field rows from the visual builder. Non-empty configuration selects only those fields.
fields_mode inherit custom preserves an intentionally empty selection; otherwise empty fields inherits compatible context fields.
field_overrides Empty Older field rows, read only when fields is not supplied.
facets all Retained legacy attribute; field selection is controlled by fields, not this value.
show_submit yes no hides the button and retains Enter submission from text/range fields.
button_text Translated Search Plain visible label.
button_style 1 Current enabled theme style; unavailable styles use an enabled fallback.
button_size default xs, sm, default, lg, x2, x2-large, x3-large, x4-large.
button_icon Empty Canonical theme icon reference such as fontawesome/search. Current passive SVG is resolved on render.
submit_col_lg 12 Desktop width, 1–12.
submit_col_md 12 Tablet landscape width, 1–12.
submit_col_sm Empty Tablet portrait width, 1–12; empty inherits mobile.
submit_col 12 Mobile width, 1–12.
preserve_params Empty Up to 50 comma/space-separated public GET parameter names to retain from the source URL.
el_class Empty Existing CSS helper classes on the form.
form_id Empty Explicit form ID; use a different value for each form on the page.

Field rows

Use the Page Builder field editor to maintain the encoded rows. Each row accepts facet_id, renderer, label, placeholder, show_label, enabled, col_lg, col_md, col_sm, and col. Labels/placeholders inherit when empty; visibility and inclusion default to yes. Widths default to 12 except portrait, which inherits mobile. The four breakpoints are 992, 768, 576 and below 576 pixels.

Only compatible renderer overrides are honored. Missing or disabled custom fields are omitted without unexpectedly adding every context field. Custom rows are limited to 100 and choices to 500. Text/suggestion controls submit one canonical value; use checkboxes or multiple selects for multiple values. Suggestions are not an interactive AJAX facet.

Destination and parameters

A GET submission replaces the query in its action URL. The renderer therefore preserves safe destination query defaults as hidden fields, retains the fragment, and avoids duplicating an owned facet's value. Destination defaults take precedence over parameters preserved from the source URL.

Source pf_ state and sensitive parameter names, including credentials, tokens, nonces and preview values, are not copied. Public parameter names must start with a letter and contain only letters, digits, underscores or hyphens, up to 64 characters.

No additional public style or script is needed. The form uses existing theme grid/form/button helpers and keeps rendering independently of the Page Builder administration setting.

Verification

Check destination restoration with no selection, numeric zero, multiple choices and ranges. Verify labels, keyboard submission and all four responsive widths. Disabled Faceted Search, missing contexts and invalid destinations render nothing rather than stored shortcode text.

See Build a Search Gateway.