Let’s be honest, the default WordPress search widget isn’t exactly a powerhouse and not that great at finding content.
If you want to help your customers find what they need faster, then you need to customize your site’s search widget. This provides a better user experience and encourages your visitors to spend more time on your site.
Now, there are different ways to make changes to the search widget, but they involve tweaking code or hiring a developer. But you can easily modify the widget with the right WordPress plugin, like SearchWP. It gives you complete control over how search works on your site.
In this article, we’ll show you how to customize your WordPress site’s search widget using a plugin.
Why Customize Your WordPress Search Widget?
Site search is an important feature people use to navigate websites. In WordPress, you can add a search widget to different locations of your site, like in the sidebar, navigation menu, or within the content. Your site visitors can then type into these search forms to find what they need quickly.
However, the default WordPress search widget is not very good at finding site content. It is slow and only searches certain content types like posts, pages, and media content. Your users can’t find a match using other attributes like tags, categories, or custom fields.
This means your site search may exclude relevant results sometimes. Once your site visitors can’t find what they’re looking for, they’ll have to check elsewhere.
Customizing your WordPress search widget will help you avoid losing potential site traffic and sales. Your site visitors can now search everything on your site. As a result, they will get a more accurate and faster search experience.
A custom WordPress search widget allows you to control how your site looks for search results. You can choose additional sources to include in the search process, and also rank attributes higher than the other when searching your site.
For example, you can rank a PDF file’s excerpt higher than the document content. So, when the user searches for a keyword, WordPress will prioritize matches in the excerpts over the document content.
If you have a WooCommerce store, then customizing your search widget allows shoppers to find accurate matches using product attributes like categories, tags, SKUs, product details, documents, and shipping classes.
That said, let’s see how to customize the WordPress search widget without writing any code.
Customize WordPress Search Widget on Your Site
Are you a WordPress newbie? Do you want to fully customize your WordPress search widget without hiring a developer?
The easiest way to do this is to use a WordPress plugin like SearchWP.
As the best WordPress search plugin, it offers features that make it easy to customize your WordPress search widget. You can choose which sources to include in the search process and which content attributes to check first.
For example, you can use the plugin to add search by category to your WordPress site. So, site visitors can now find results faster by searching a specific section of your site.
Here are some other interesting features you get:
- PDF and Office Document Indexing: SearchWP lets your site users search the content of your PDF files and other text-based documents. This can come in handy if you own a bookstore or any site with lots of documents, making it easy for your visitors to find PDF files.
- WooCommerce Integration: The SearchWP WooCommerce addon can index product attributes like categories, tags, product type, color, size, product details, and shipping classes. This way, your site visitors can find the products they need even faster.
- Custom Fields Support: Custom fields help you store extra data about your site content. Unlike the default WordPress search, SearchWP can search custom fields.
Ready to create your first WordPress custom search widget? To get started, simply follow these steps:
Let’s show you how to do it!
Step 1: Install and Activate SearchWP
First, you’ll need to visit the SearchWP website and sign up for an account.
After you’ve subscribed to a pricing plan and created a new account, the next step is to download the plugin files.
You’ll find the plugin by logging into your SearchWP account area by going over to the ‘Downloads’ tab and clicking the Download SearchWP button.
Next, you will need to log into your WordPress admin area and install SearchWP to your site.
If you need help, then you can follow this guide on how to install a WordPress plugin.
Once you’ve now fully set up the SearchWP plugin, the next step is to adjust your search engine settings.
Step 2: Set Up Your Search Engine
SearchWP allows you to control how your site looks for content by customizing the search engine on your site. You can change the default WordPress search or create new search engines.
You can then choose from different content sources like posts, pages, products, and the media library. Not only that, but you can also decide how relevant you want each source attribute like title and slug to be.
Another benefit of using SearchWP is that you can set up more than 1 search engine for a site. This means you can display different search bars in different locations on your site. For example, you can add a search engine that looks for products only on your shop page and add another search engine that searches your entire site.
First, you will need to head to SearchWP » Algorithm from the WordPress dashboard and click the ‘Sources & Settings’ button.
Next, you’ll see a pop-up with a list of sources and additional options. You can choose from sources like posts, products, comments, and media files. The available options may vary from site to site, based on the plugins on your site.
After selecting your settings, you can also select some additional options. For example, you can enable keyword stemming.
Keyword stemming helps your site to search for words similar to what the user is looking for. If it’s enabled, your site will also search for words like ‘running’ when the user types ‘run’. After choosing the options you want, simply click Done.
Next, it’s time to decide which content attributes you want your site to consider when searching for content.
You can adjust these settings for each source you’ve added to the search engine. Simply scroll to the source you want to edit and click Add/Remove Attributes.
You’ll now see a pop-up with a list of attributes for each source. By default, SearchWP will look for results in the title, content, slug, excerpt, and author.
You can remove any of these attributes by unchecking the box next to it. Or you can add other advanced attributes like custom fields and taxonomies. These attributes can be categories, tags, or even product variations like color and model.
If you select these attributes, your site visitors can now find products easily by simply typing any attribute into the search bar. When you’re finished, click the Done button.
The next thing is to add other specific rules to your search engine settings. For example, you can decide to only search for pages published after a particular date.
To do this, simply click the Edit Rules button.
On the next page, you can adjust the rule’s settings based on your needs.
Go ahead and click the Add Rule button.
After that, you can enter the conditions for your new rule.
Let’s say you want to select whether to show or exclude entries for posts published before a certain date, display results from specific categories, or enter post IDs to filter content.
When you’re finished, simply click the ‘Done’ button.
Finally, it’s time to adjust how your search engine ranks each of the content attributes you added earlier.
For example, you can choose to rank a page’s slug higher than the excerpt. When SearchWP is looking for search results, it’ll first check the slug before checking the excerpt.
Each attribute has its own slider. You can adjust each of them to determine the attribute’s relevance.
You’ve successfully chosen your content sources, added attributes, and adjusted their relevance.
You can now click Save to apply your new settings and then click the Rebuild Index button.
After customizing your WordPress search settings, the last step is to add a widget to your site.
Step 3: Add a Search Widget to Your Site
You can add your new custom search widget to different locations of your WordPress site.
Some WordPress themes have a search widget in some locations by default. In this tutorial, we’ll show you how to add one to your sidebar. It’s easy for site visitors to find the widget in this location.
You can add a new widget to your site by going to Appearance » Widgets in your WordPress dashboard.
Next, you can choose where to add the widget and click the + icon.
We’ll select the Sidebar option for this tutorial.
Next, you will need to a ‘Search’ widget block to your sidebar.
Simply click the ‘+’ button and choose the Search block.
You should now see the search block in your sidebar widget area.
Now, click Update in the top right corner to save all your changes.
Now, when visitors go to your pages or posts, they’ll see your new custom search widget. This widget will search your site based on your new custom settings.
What’s Next…
Do you want to create custom search forms for your website? With SearchWP, you can create multiple search forms for your website.
It offers different layouts to choose from and customize its appearance to match your website theme and brand.
You can also define which engine your custom search form will use, as SearchWP lets you set up multiple Engines to find content.
To learn more, please see our guide step-by-step guide on how to create a custom search form in WordPress.
We hope this article helped you learn how to customize the search widget in WordPress. You may also want to see our guides on how to add a custom WooCommerce search widget and how to add autocomplete search to your site.
Ready to create a better and more personalized WordPress search experience? Get started with SearchWP today!