Let's face it. When it comes to search, there is only one game in town — Google. Another fact that you should face is that the built-in search in WordPress is not that great. Put those two ideas together and it's clear that what you need to do is integrate Google's Custom Search (GCS) into you blog. You get a better search, and some opportunity to generate AdSense revenue.

To be honest, I'd be surprised if you generate much in the way of revenue. The reason to do this integration is to improve your readers experience. Frankly, if you always use user experience as the reason that you do things to your blog, you will often come out ahead in the long run in any case.

Google Custom Search Overview

As you can see, I have successfully integrated GCS into my sidebar. To do this, you basically need 3 things.

  1. You need a Google AdSense account
  2. You need code for your sidebar
  3. You need code for the results page

The way GCS works is that you first create a custom configuration in your Google AdSense account.  The result of that step is the generation of two pieces of JavaScript.  One piece of JavaScript goes in your sidebar (or wherever you want the search bar).  This first piece of JavaScript is the code that presents the search box and search button to the user.  That code includes information that points to your search configuration on the Google AdSense servers.

When a search is submitted by your visitor, the first JavaScript program runs and loads the a results page that you have specified in your AdSense configuration.  In our case, that results page is regular WordPress page that has some JavaScript in it.    The results page JavaScript is the second script provided by Google mentioned above.   That code interfaces with the Google AdSense servers to get and format the results and AdSense ads.

Best Ways To Implement Google Custom Search

There are at least two ways to implement this Google Custom Search integration.  You can do it manually by following the excellent documentation provided by on Maki's blog over at DoshDosh.com, or your can use the Google Custom Search plugin.

As part of my research for this article, I tried the plugin.  Unfortunately, my theme was not compatible with it (I think because of some customizations that I have done to the WordPress theme code and file locations).  I suspect that most simple themes will work just fine.

I like to understand how things work, so I used the instructions at DoshDosh.  If you try to implement this and have problems, please feel free to leave a comment and I will try to assist.

Parting thoughts about Google Custom Search

Some things to consider based on my experience with this.

  1. Don't expect to make tons of money on AdSense for search ads.
  2. Try the plugin first.  It's easier to implement if it works.
  3. If you have a narrow page area like I do, ads to the right will not work.  I recommend that you use ads on the top and bottom (specified in the AdSense search setup interface).

Let me know if you try this and you get it to work, or if you need some help.

Thanks,
Mark

TEST