Lodestar
How it worksFeaturesStoresPricingFAQGuides
Home / Guides

How to add a product search bar to your WooCommerce header

A visible search box is one of the cheapest ways to help shoppers who already know what they want. Here are four ways to add one, from easiest to most flexible.

By Niral Sura, Flying Star. Updated 2026-10-28.

1. Use your theme's setting

Many themes have a header search option. Look under Appearance, Customize, Header. It is the fastest route and it matches your design. Check that it searches products and not blog posts.

2. Use the Product Search block

On a block theme, open the Site Editor, edit the header template, and add the Product Search block. This one searches only products. The plain Search block searches everything on the site.

3. Use a widget or menu item

Classic themes may offer a search widget in a header widget area. Some page builders also have a search element you can drop into the header.

4. Use a shortcode

A shortcode lets you place a search box anywhere, including a header slot that accepts HTML, a page, or a sidebar. Lodestar Search adds [lodestar_search] for this.

What to check afterwards

Works with the box you already have

Lodestar Search attaches to the existing search box wherever it sits: header, sidebar, mobile menu, pop up or the block editor Search block. If a box is not picked up, you can point Lodestar at it with a CSS selector in the settings.

Instant product search dropdown attached to a WooCommerce store header search bar
The dropdown attaches to the header search box and matches the theme.
The same WooCommerce search box on a phone
The same box on a phone.
Try it on your own store
Lodestar Search is a free WooCommerce plugin with typo fix, synonyms and instant results.
Get the free plugin

Questions

How do I add a search bar to my WooCommerce site?

Use your theme's header setting, a Product Search block on a block theme, a widget, or a shortcode.

Why does my header search show blog posts?

It is using the general WordPress search. Use a Product Search block or a plugin that searches products only.

Do I need to change my theme?

No. A search plugin can attach to the search box your theme already has.

More guides

WooCommerce search analytics: what to track and howSee what your shoppers search for in WooCommerce. What GA4 can and cannot see, and how to track searches that find nothing.WooCommerce search for a large catalogueAt thousands of products the default search slows down. What breaks first, what to check, and how to keep search fast as you grow.WooCommerce search synonyms: ready to use examplesCopy these synonym lists for electronics, fashion, home and beauty stores. Plus how to find the synonyms your own shoppers use.