Improving the Default Search Experience in WordPress
No matter what the genre or niche of your website is, the search functionality forms an integral part of your site. In fact, it is almost impossible to think of the internet without the search function. A search bar helps your visitors to easily locate content on your website and as a result, plays a crucial role in converting casual visitors to regular subscribers. Sadly, the default search functionality in WordPress leaves a lot to be desired. Agreed, WordPress offers out of the box search function and you can easily add a search bar to your sidebar using widgets, but the overall performance of the WP search mechanism is below par, to say the least.
In this article, we shall be taking a look at the drawbacks of WordPress’ default search mechanism as well as useful tools that can help you get the most out of it.
Taking A Closer Look at WordPress Default Search
The Limitations of WordPress Search
“WordPress default search kinda sucks.”
Well, I guess that sums it up? The default search in WP misses out on many crucial areas. In fact, WP default search is so disappointing that even WordPress.org does not use it -- try a search using the bar in the header at WP.org; you will notice that the results are provided using Google custom search.
At the very basic level, WP search looks for your queries in the published posts and pages -- literal matches primarily. Almost all CMSs come with a default search functionality and if I may say so, WordPress’ search fares way worse than that of most others. All said and done, WordPress needs a better search algorithm.
Oh, and wait, we are not yet done talking about the limitations of WP search.
- Currently, the search function in WordPress lists the results chronologically, that is, the most recent posts come at the top, followed by the older ones. However, I feel that a better choice will be to arrange the results on the basis of relevance. The basic purpose behind any search is to locate information or content that is relevant to the specified keywords, and a chronological search can make you browse through several irrelevant posts if the actually relevant one is buried below the newer articles.
- WordPress search does not allow the users to specify advanced parameters. You cannot refine your search, search inside a given category or search within a search. Similarly, you cannot filter search results either.
- Also, WordPress only searches for the specified keywords within posts. It does not include the comments in its search -- this is a rather strange exclusion considering the fact that WP evolved as a blogging platform and the comments section of a popular and active blog can hold a great deal of useful information.
- Unless your theme provides this functionality, keywords are not highlighted.
Overcoming The Limitations: Useful Plugins
1. Relevanssi
Relevanssi is a useful plugin that replaces the default WP search with a partial-match search. It can sort results on the basis of relevance, and even search within comments, tags, categories, custom fields and shortcode content.
The plugin lets you filter results, search within custom taxonomies and even displays a Google-like “Did you mean...” section with search results. The plugin also has a premium version which comes with user support, multisite support and spelling correction.
2. Dave’s WordPress Live Search
Dave’s WordPress Live Search lets you implement “live search” on your site using the default search function and jQuery.
http://www.youtube.com/watch?v=7CGR2bJ1mLMBasically, this is your website’s version of Google Instant -- results are queried for and produced as soon as the user starts typing in the search box. The plugin is internationalization ready.
3. Search Everything
As the name suggests, Search Everything lets you include sections of your site that are otherwise omitted from search results. This plugin can search within pages, custom post types, custom taxonomies, comments, attachment post types, excerpts, categories, custom fields and tags.
You can also specify parameters such as “search within approved comments” instead of “search all comments”. The plugin also lets you highlight keywords in search results.
4. Better Search
Better Search plugin replaces the default WP search and employs a contextual search mechanism that sorts results on the basis of relevance. The plugin is not really popular, and has had only 15,000+ downloads (compare this with the 322,870+ downloads of Relevanssi). Also, Better Search has not been updated for almost a year.
5. WP Search
WP Search also sorts results on the basis of relevance. It supports Boolean operators and wildcard characters. Sadly, the plugin is compatible up to WP version 3.2 only, and has not been updated since October 2011.
Additional Resources
1. Using Google Custom Search
What? You actually thought you’ll finish an entire article talking about “search” without reading about Google?
Using Google Custom Search, you can easily add a Google-powered search box to your website.
http://www.youtube.com/watch?v=Qd9z48Bo8ZAThere are two ways to implement Custom Search on your WordPress blog.
The first method lets you accomplish the task without using a plugin. Simply navigate to the Google Custom Search page, and create a custom search engine. You will need to provide basic details such as your website URL, etc. and then Google will generate a search ID for you. Thereafter, you will be presented with a piece of code that you can copy and paste wherever you want the search box to appear (say, in your sidebar using the arbitrary text widget). That is it, you are good to go (though it will take sometime before Google bots actually index your entire site and results start showing up).
The second method is to use the Google Custom Search plugin. Install, activate, head to plugin’s settings page, and specify your unique search ID. All done! You can place the search box in a widget or even as a pop-up dialog.
2. Swiftype
Swiftype is a full-fledged search mechanism for websites and mobile applications. It comes with its own detailed search analytics, developer API and has support for mobile devices.
https://www.youtube.com/watch?v=pITuOcGgpBsConsidering the fact that Swiftype also caters to mobile apps, it is backed by SDKs for Android and iOS.
Search results are sorted on the basis of relevance, and you have the ability to overrule the sorting and specify your own custom ordering. While Swiftype can be used by any website irrespective of the CMS, it also comes with a WordPress plugin to make integration easier.
Swiftype comes with both free and paid plans. The cheapest premium plan costs $19 per month and lets you have 2 domains, perform 1,000,000 monthly search queries and view analytics for past 30 days. There are other plans available as well suited for bigger sites and power users.
http://www.youtube.com/watch?v=rukXYKEpvS4Naturally, unless you can manage with the free version (which will not have support and offer a much lesser number of monthly queries), you will have to invest a decent amount of money in order to use Swiftype.
Verdict
So, which service should you use?
In general, the Relevanssi plugin fares way better than most others in its league. I tried only the free version, and it does manage to improve the search experience overall. You can use it alongside Dave’s WordPress Live Search to deliver quick results as well.
The Search Everything plugin does a good job of include sections of your site that are left out by the default search. However, it does not do much to improve the overall search mechanism, nor does it raise the relevance of search results.
If you do not want to install another plugin, Google Custom Search will be your best bet. Agreed, it may not have all the fan-fare associated with some of the plugins listed in this article, but at the end of the day, Google does what you want it to do -- deliver amazing search results.
Swiftype is another terrific option when it comes to custom solutions. However, having a free plan with severe limits on the number of queries does not sound good to me -- what if you have a traffic hike and your visitors search your site, only to find out that the search is not working because you did not pay for it? Plus, $19 per month is an amount that can pay for almost 4 months’ hosting for those who are using a shared server. This simply shows that Swiftype is not a tool for the everyday casual blogger. On the other hand, if you have the budget and can opt for the paid plans, go ahead! Swiftype is worth the investment if you have a large site.
What do you think of these tools to help you boost the search functionality on your website? Have your say in the comments below!
(dpe)
Good writeup. We are debating between keeping Relevanssi or switching to a third-party off-site option like Google or SwiftType. On-site search can hurt performance for websites our size.