Knowledge Base

Table of contents

More concepts

Share the post

Search function on your website

A search function on your website is a search bar that allows visitors to search for pages, articles, or products themselves. They type a word and receive a list of results from your own website.

What is a search function on a website?

A search function is an input field, usually with a magnifying glass, into which visitors type what they are looking for. The website then displays the matching pages or products. It is a second way to find your way, in addition to the menu.

Some visitors prefer clicking through the menu, while others search directly. Especially on a webshop or a website with many items, a large proportion of visitors prefer searching to browsing through categories.

Does your website need a search function?

Not every website needs one. A simple rule of thumb:

  • Small business website with ten to twenty pages: usually not. A clear menu works better. A search bar that returns the same three pages for every search query adds little value.
  • Website with a blog or knowledge base: Yes, as soon as there are so many articles that a visitor loses track.
  • Webshop: Almost always. Anyone who knows which product they are looking for wants to type in the brand or name and see immediately if you have it.

If in doubt, check Google Analytics to see which pages visitors view before leaving. If they spend a long time searching through the menu without finding anything, a search bar is often a quick improvement.

The default WordPress search function

WordPress has a built-in search function. You can add a search bar as a block or widget, and the results appear on a page with ?s= and the keyword in the address.

That standard search function is simple. It searches titles and text of pages and posts and does not sort the results by what fits best. It does not catch typos, plurals, or synonyms. It often fails to find fields outside the regular text, such as product attributes or article numbers. For a small website, that is sufficient; for a webshop with hundreds of products, usually not.

What does a smart search bar do?

A smart search bar, with a plug-in or an external search service, goes further:

  • Suggestions while typing. After just a few letters, the visitor already sees products or pages, often with an image and price.
  • Catching typos. Whoever misspells “raincoat” still gets raincoats.
  • Synonyms. You stipulate that “bank” and “sofa” mean the same thing on your website.
  • Search in attributes. Brand, size, item number, and category count.
  • Filters on the results page. The visitor refines by price, color, or availability.
  • Set order. Products that are in stock or sell better first.

What makes a good search function?

  • Visible. At the top of the header, in a fixed position. On a phone, it can be a magnifying glass that opens the field.
  • Quickly. Results must appear in an instant.
  • Never a blank page. If the search function finds nothing, show popular products, categories, or a way to get in touch. A bare “No results” message is a dead end, just like a bad 404-page.
  • Usable for everyone. The search field has a label that screen readers can read aloud and works with the keyboard. See also digital accessibility.

Measuring search queries

What visitors type into your search bar tells you exactly what they expect from you. Google Analytics 4 can automatically measure search queries on your website via the advanced measurement option. It recognizes the keyword in the results page address, including the parameter s who uses WordPress.

Check those keywords a few times a year. You will then see:

  • products or services for which there is demand but which you do not offer;
  • words that customers use and you don't, usable for your texts and keywords;
  • information that cannot be found via the menu.

Search results and Google

The results pages of your own search function do not belong in Google. They contain no original content and there are endless numbers of them. Therefore, do not have them indexed and do not link to them from your menu or sitemap. Most SEO plugins handle that by default; just check.

Common mistakes

  • A search bar on a small website that constantly finds nothing or everything.
  • Leaving the standard WordPress search function on a large webshop.
  • Hide the search field at the bottom of the footer.
  • Never look at what visitors are searching for.

NB: A search function does not solve a messy structure. If visitors have to search for everything because the menu is unclear, start with the menu and the internal links. The search bar is an addition, not a replacement.

Frequently Asked Questions

How do I add a search function to my website?

In WordPress, you add the search block to the header or a widget area. If you want suggestions while typing or to search within product attributes, you need a search plugin or an external search service.

Is a search function good for SEO?

Not directly. Google does not use your internal search bar. However, it does help visitors find what they are looking for faster, and the search queries give you ideas for new pages.

Related concepts

Are customers not finding what they are looking for in your webshop?

We improve the search function, filters, and structure of your webshop so that visitors find the right product faster.