September 23, 2019

How to Create Amazon-like Search Boxes for your WordPress Website

A Search bar is as essential to your website as a map in a new city.

If you have an e-commerce or e-services website, often the first thing a visitor looks for is a search bar.

How long people engage with your website heavily depends on how easily they find what they are looking for and how relevant the things they actually find are. Which is where search bars are worth their weight in virtual gold!

Moreover, an intuitive search bar plays an important role in providing a wholesome user experience and keeps your customers coming back for more!

You definitely need an on-site search box on your website & here’s why:

  • The secret to happy customers is giving them exactly what they need. Whether it be articles, tv-shows, or shoes, people appreciate it when they can find what they are looking for with minimal efforts. Do you know what can help? A great search box!
  • Visitors stick around when they can easily get around your website. A search box is a great way to quickly search for & navigate to various sections, pages or posts. It helps make your site a breeze to use.
  • Happy customers = quicker conversions = 🙂

Also, it’s 2019 and we are used to a world governed by search engines & search boxes. So, if only to continue that normalcy for your visitors, you should definitely have a convenient search box on your WordPress website.

What makes search boxes on Amazon, YouTube or IMDb so great?

They do an amazing job of catering to the visitors’ needs.

Each of these websites has a conveniently located search box that shows highly-relevant results to visitors. They also employ features like recommending related search queries, accounting for incorrect spelling, letting users further refine their searches or broaden them to include more related fields.

All of this works to fulfill the end goal of getting users to what they are looking for, quickly and effortlessly.
Having said that, we need to admit upfront that WordPress’ native search bars aren’t that great. They aren’t intuitive for one, nor do they have advanced search filters for more relevant results.

In such a case, it’s better to use a WordPress search plugin, so you can set up an effective search box for your WordPress website.

How to add advanced search boxes to your WordPress website: A step-by-step guide

One of the easiest ways to create a search box with all the desired functionalities is to use a plugin. We’ll be using the Relevanssi plugin for WordPress, which is a feature-rich plugin to enhance your search box.

Step 0 – Installation & Set-Up

Before we can start the first you would need to do is get the Relavanssi plugin.

The installation process is quite standard:

  • Go to Dashboard -> plugins -> Add new
  • Click on Upload Plugin and upload the Relevanssi zip file
  • Activate!

And you’re ready to go!

Step 1 – Build an Index

The first thing you need to do to set up a search feature is to build an index. This is the lookup table that is referred to when searching for relevant results. Exactly like how you would use an index on a book!

Go to Relevanssi Settings and navigate to the Indexing tab.

The Build an Index feature will create your index in just a click. However, note that clicking on this option will empty your index and create a new one every time.

Alternatively, the Index unindexed posts button can be used anytime to take care of just the unindexed content on your website.

Relevanssi Search Options

You can always check the specifics of the indexing process with State of the Index.

Relevanssi search options state of the index

Step 2 – Configure Index Settings

Now that we know how to create indexes, let’s go over what you can do to make them better. Indexing options allow you to configure what content gets included when creating search indexes.

Let’s start with the basics: Post type & taxonomy

post and taxonomy settings

Comments contain discussions, explanations & corrections often by people with expertise in the domain. Indexing comments can be useful to make all essential information available to the reader easily through search results.

Author display name lets people search for results from a specific creator, product-maker or author that they like. If you’ve used custom fields & excerpts to provide additional information about posts you can index those too for refined search results.

configure comments, excerpts, and custom fields

Shortcodes are a very effective way to help visitors find exactly what they are looking for. They contain highly relevant keywords & should be indexed to display relevant results.

configure shortcodes - expand shortcodes and disable shortcodes

Note that the content needs to be re-indexed for any new settings to reflect.

Step 3 – Index User Profiles & Subscribers

In addition to Author Profiles, you can index User Profiles as well. This includes first name, last name, display name, and user description.

You can also opt to index subscriber user roles, when usually only author, editor, contributor and admin user roles are indexed.

Index User Profile

These features are quite effective if you have a forum or social networking style of websites. This way readers can look-up contributors, creators or fellow users that they like.

Step 4 – Index content in PDF format

If you have content like e-books, guides or instruction manuals present in PDF format, enabling this option adds this content to the search results as well.

Index Content in PDF Format

Step 5 – Displaying Search Results

Navigate to the Searching tab.

This section can be used to customize how your search results appear.

Default operator, order and Keyword Matching

Default operator

OR: displays result if either query term matches. Will generate broader search results
AND: displays result only if all terms match. Generates more refined search results

Default order

Choose if search results are to be displayed in order of relevance or post date.

Keyword matching

Choose if results are to be displayed only if the post includes the whole word, partial word or partial word in case the whole word isn’t present.

Step 6 – Setting up Search Weights

Weights are a great way to ensure that content that is more relevant & has more importance ranks over less important content. What constitutes as more relevant can differ based on what your website is about.

If you have an e-commerce website you can assign a higher weight to product pages while for a cooking blog your recipe pages will have higher priority.

Weights can effectively help you provide the correct information with ease.

High and Low priority elements

Step 7 – Index Synonyms

Broaden user search to include results that contain synonyms of the searched keyword. This ensures that the user is displayed results that could be relevant but do not contain the exact keyword.

‘Synonyms’ can also include different spellings like ‘color’ & ‘colour’ or even a frequently misspelled version of the word.

This helps display search results that take into account not just what a user types into the search bar but also the intent behind it.

Index Synonyms

Alternatively, if you want to only display results that contain both of the words you can enable this option in the Index options settings.

Indexing Synonyms

Step 8 – Remove Stop Words from Search Results

Choose words that are not to be considered when displaying search results. These can differ based on your niche or domain.

Relevanssi already has a comprehensive list of common stop words like ‘a’, ‘in’, ‘at’, ‘most’, ‘where’, etc. All of them can be removed if required.

You can add a list of words separated by commas to add them to the existing list.

Remove Stopwords

Or you can select & add them conveniently from a list of suggested stopwords.

Select the Stopwords from suggested candidates

Step 9 – Include Related Posts in Search Results

Display related search results on posts based on various keyword resources like the title, tags, categories, etc.

Include Related Posts in search results

You can also decide what to display if there are no related search results, how many related results to display, and how to style the results.

This way a reader can easily navigate from one related post to next for information on a particular topic.

Why Relevanssi was our choice of plugin

There are several reasons why the Relevanssi Search plugin was our preferred alternative.

  • It’s a straightforward & simple plugin that can be used by people with all level of expertise. It requires no coding or high-level technical knowledge.
  • It is can be used for all different types of websites including social media websites, e-commerce websites, online media streaming website, e-services, and job portals.
  • It comes with an excellent support system to solve any queries you have quickly and efficiently.

There are also many advanced options with the Relevanssi plugin that you can explore: multisite search, advanced indexing settings like minimum word length, internal links and more.

To Summarize

Search boxes are a great way to enhance your website, it helps your customer find what they need and adding one to your website takes minimal efforts on your part. It’s a win-win situation!

They also make your website so much easier to use and navigate through. Give your visitors the best experience with a comprehensive and powerful search feature!

Have you added a search box to your website? How has it helped? Drop us a comment & let us know!

Disclosure: Some of the links in this blog post might be affiliate links. When you purchase through a link on our website, we receive a small commission, at no added cost to you, which helps us run Epitrove and keep producing great content. This does not influence our recommendations; we only recommend products we work with or love. Thank you for your support!

Lavanya Deshmukh
Lavanya Deshmukh

Computer Engineer, food enthusiast and die-hard Harry Potter fan that now writes content full time for Epitrove


Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.