Improving WordPress Search with the Google Custom Search API
Let’s face it, the default WordPress search leaves a lot to be desired. Results are listed by date rather than relevancy and it doesn’t return any results or suggestions when words/phrases are misspelled. So what are some of the options out there if you want to improve the quality of search results returned by your WordPress powered site?
We recently completed a site for This Land Press using the Google Custom Search API. With over 200 contributors, 1000’s of articles, and content broken up into different sections, they wanted to make it easy for users to find what they’re looking for.
Here’s an example of what a search for “John Fullbright” yields:
The integration is seamless and we’re returning all of the elements you’d expect to see with the search results: date, title, excerpt, thumbnail and even the post category.
Additionally, you can also make several modifications to your search results via the Search Control Panel.
- Exclude specific pages or even an entire directory from showing up in your search results.
- Promote specific pages and have them appear at the top of search results for a specific query.
- Expand search results by defining Synonyms for search terms
There are 2 different versions of Custom Search offered by Google. There’s the free version which allows you to make up to 100 queries per day (ideal if you have a small site with little traffic) or the paid version which bills at $5 per 1,000 queries (your first 100 queries are free).