In this easy-to-follow guide, we’ll explain how to customize the WordPress search results page to help your users find the content that matters most to them.
Once you’ve customized your page, you’ll also learn how to enhance your visitor’s search experience even further by activating Live Ajax Search, which is a powerful feature that allows users to see search results as they type, providing a more seamless and engaging user experience.
Why Create a Custom WordPress Results Page?
Out of the box, your core WordPress installation comes with its own basic search functionality.
It works, sure, but it could certainly be much better.
It’s not uncommon to find that search queries throw up irrelevant results or -worse- no results at all, even when you know that you have content that perfectly meets those queries.
That’s not to mention that the default search function has a bad habit of slowing down your site, especially if multiple site visitors are using it at once.
By creating a custom search results page on WordPress, you not only create an easy way to speed up your WordPress site, but also improve its usability, both of which can contribute significantly to improved SEO performance, better search rankings, and more traffic.
How to Customize the Search Results Page in WordPress: A Simple 8 Step Process
To help your visitors find what they’re looking for with WordPress search, we’re going to use one of our favorite plugins, Ivory Search.
Available in free and premium versions, this handy tool helps you override the default search function with a vastly improved internal search engine, complete with more thorough and accurate results.
Here’s how it works.
1. Install and Activate the Plugin
First things first, you’ll need to decide whether to opt for the free or paid version of Ivory Pro.
As you’ll see throughout this guide, the free version alone gives you much more control over your site’s search functionality.
Meanwhile, the premium versions, which run from $19.99 to $49.99 per year, give you even more options, such as ordering search results, allowing users to search your eCommerce store by SKU, and filtering more types of content from search.
If you’re opting for the free version, you can do this via the in-built plugin directory.
If you’re going with the paid version, you’ll need to download it via the Ivory Search website. Then, log into WordPress and go to Plugins – Add New Plugin – Upload Plugin.
Find the downloaded plugin (as a compressed .zip file) on your hard drive, upload it, and activate it.
2. Create a Custom Search Form
Once installed, you’ll find Ivory Search in your main dashboard menu.
By default, the plugin opens up on the Search Forms page. Here, you’ll see a small list of default search form templates, along with the ability to add a new form.
This is where you’re going to start, as it’s the search form itself that will power your optimized WordPress search results.
To begin then, simply click Add New Search Form.
Here, your first task is to click where it says Add Title, and give your new form an easy-to-remember name.
3. Configure Your Searchable Content
Next, scroll down to the Configure Searchable Content options, where you can fine-tune which types of content should be indexed and served up in search results.
These options include:
A. Post Types
By default, Ivory Search includes posts, pages, and media files in your search. If you’re running WooCommerce, you can also choose to include products in your search.
If you want to exclude any of these post types, simply toggle them off.
For this tutorial, we’ll be leaving all three active. However, there may be times when you want to deactivate one or more.
For example, you may decide to exclude pages so that users focus on your blog content. Or, if you’re running an eCommerce store and publishing blog content, you may want to exclude everything except products to help you increase sales.
Either way, you can further tweak these searchable post types with the remaining options.
B. Posts
Under the Posts tab, you can choose to make all your posts searchable or just specific ones.
If you choose only to include selected posts, toggle that option ON and simply highlight the posts you want by holding down the control (Windows) or Command (Mac) key.
You can do the same with your taxonomies, either hand-picking which categories and tags to include or allowing all of them to be searchable.
C. Pages
In the next tab, you can repeat this process for your pages.
While it may make sense to include as much of your content as possible, you can use this option to filter out results that are likely irrelevant to most search queries, such as your cookie policy or affiliate disclosure.
D. Media
At this stage, it’s important to note that if you choose to include only certain posts or post-types in your search, you’ll see a warning notification in the media tab.
This tells you that media won’t be searchable as Ivory Search is now set to only search for specific posts, pages, or taxonomies.
If you want to include media, you’ll need to go back, and reset the first three options to the “include all” setting.
Do that, and the notification will disappear, meaning you can now choose to include all your media or just select files.
Those of you who opt for Ivory Search Pro Plus can also choose to include only specific types of media files, with options including:
- Images
- Videos
- Audio files
- Text files
- PDF files
- Document files.
E. Extras
Finally, you can move to the Extras tab to configure, which parts of your content are searchable.
As you can imagine, this is incredibly handy for improving the accuracy, relevance, and comprehensiveness of your search results.
For example, say a user wanted to find information on our website about 404 errors.
If our WordPress search engine only scanned post titles, it wouldn’t include our blog post on the impact of broken links.
That post doesn’t include the term “404 errors” in the title, although the term is used frequently within the post itself as well as in the excerpt.
So, by ensuring Search post content and search post excerpts are turned on, we make it easier for our audience to find more posts that accurately address their search queries.
Elsewhere in the extras tab, you can also.
- Include specified custom fields in your search results
- Choose whether or not to include password-protected content
- Include content by specific authors (Pro version only)
- Include posts with a specific number of comments (Pro Version only)
- Include posts created within a specified date range.
This last feature is especially valuable as it allows you to exclude old content that may be well out of date and, thus, not as relevant to your users.
Finally, one feature we really like here is the Post Status option, which allows you to include posts that are still in draft.
If you’re running a large blog with lots of fresh new content being constantly created, this will make it easy to create a custom internal search function so that you can easily find draft posts you need to review or keep working on.
Whichever options you choose to configure here, ensure to hit *Save* when you’re done so that you can move on to the next step.
4. Exclude Specific Content
Given that you could manually select which content to include in the previous step, the Exclude options may seem a little redundant at first, but think about it this way:
Imagine you have 200 blog posts on your site, and you want to include all but one of them.
Do you really want to go to the trouble of manually selecting 199 posts just to ensure one post doesn’t show up?
If you’re in a situation like that, it’s much easier to switch to the Exclude tab, and simply select the one post, page, or media file you don’t want appearing in your search results.
5. Customize the Search Form Style
Improving your site’s search functionality doesn’t have to mean you’re left with an ugly-looking search form that clashes with the beautiful, on-brand design you worked so hard to create.
To change the look and feel of your search form, simply click Design followed by Search Form Customizer.
This will open up the default WordPress customizer, where you can change the style, colors, and placeholder text of the search bar that you’ll later place across your site.
6. Enable AJAX Search
Although this step won’t necessarily improve the search results page itself, it will certainly make your site more user-friendly, meaning your users can find the content they want much quicker.
By turning on AJAX Live Search, you create a more dynamic and responsive search experience in which results are displayed in real-time as the user types into the search input field, providing instant feedback and suggestions.
To do this, simply jump to the AJAX tab, toggle the switch to on, and then configure the multiple available options if you choose to.
Before you leave this tab, those of you running an online store can also configure which WooCommerce product details appear in the live search results to help you drive more eCommerce sales.
7. Configure Advanced Search Options
With all that done, you’re almost ready to integrate this new search functionality into your WordPress site.
Before you do, however, head to the Options tab, where you can further tweak how that function works and what results are displayed in your new customized WordPress search results.
For example, you can:
- Choose how many posts are displayed per page
- Order search results by date, author, title, slug, or post ID (Pro version only)
- Highlight the searched terms on the results page to help users understand the context and relevance of those results.
- Include results that contain either all the words in a search term or any of them. For example, with the “OR” option enabled, a search for “WordPress themes” would include posts that include either the words “WordPress” or “Themes,” which could produce less accurate results, while “and” would ensure that only posts which include both words appear in results.
- Set Fuzzy Matching options to determine whether to include full or partial-match keywords in search results.
- Switch to the Inverted Index Search Engine, which produces results faster than the default WordPress search.
If you only configure one of these options, we recommend it be the last one.
Remember, WordPress’s in-built search engine is notoriously slow, and not as well developed as it could be, making Inverted index-based search a much better option for improving the user experience of your site.
Finally, under the Others tab, you have a few remaining options, including:
- Display sticky posts at the top of search results pages to draw attention to your most valuable content.
- Display the search form only for site administrators, making it handy for creating that internal search feature we discussed earlier.
- Disable the search form if you’re not planning to use it.
- Display an error message when users fail to enter any terms when performing a search.
With all that done, click Save again, and let’s get your new and improved search functionality live on your site.
8. Add Your New Search Feature to WordPress
Since most users typically find a search bar in either the header or the sidebar, we’re going to place ours in the latter.
To do that, copy the shortcode that appears underneath the title on your form editing dashboard.
You can also find this shortcode in the main form menu.
Once you’ve copied it, navigate to Appearance – Widgets and find the location where you want to add your search form.
Add a new widget and search for Shortcode.
Paste your shortcode into the box provided, click update, and, hey presto, your new customized search results page is fully activated, and ready to help users get to the right content quicker.
Customizing the WordPress Search Results Pages: A Recap and Next Steps
Creating a custom WordPress search results page starts with building a new search form using the Ivory Search plugin, and configuring the multitude of options to take complete control over which content appears in results and how they’re displayed.
All told, the whole process outlined above took us no more than 20 minutes, and that included time spent deliberating exactly how we wanted to set things up.
Now that you’ve got this easy step-by-step tutorial in front of you, there’s no reason you couldn’t complete your search customizations much faster.
With the extra time you save, discover how you can further improve your website’s user experience by conducting a technical website audit, with practical tips and guidance from UnlimitedWP’s experts.