Better WordPress Search

Monday, November 28th, 2011

One of WordPress’ weak points is its search.  Whenever you search for a phrase, it will just return all posts with that word in reverse chronological order.  People are used to the power of Google searches, these days seemingly having the ability to guess exactly where you want to go before you even finish entering the search query.  So, prompted by our Streetsblog editors, I set about to try and improve upon the WordPress default search.

Each time I look into this problem, the landscape is different.  Different plugins are available and Google offers different ways to hook into its API.  This time I was pleased to find a perfect way to offer Google search results on our blogs.  Using Google Custom Search, I created a search engine for each of our sites that restricts its results to just those from the site.  I then customized its look and feel via css in the Streetsblog style sheet.

I ended up with a solution that integrates closely into our blogs: