A lot of WordPress installations and themes will include a search widget, allowing visitors to search your site for specific content. There are also a half-dozen WP plugins available as well which allow for advanced settings and options of your search code. With all the available search plugins, I still prefer Google Site Search which is easily the most powerful search tool out there, especially with content search. Adding a working search engine to your site helps keep visitors on your website, helps increase sales and turn-over for product search, and allows you to customize and tailor search results for look and results. The only draw back is if you want the ad-free version, there is a fee involved. So why not set up an enhanced Search tool that pays you? Setup a Google AdSense account and you can utlize on-site customizable search, ad-supported, and get paid for click throughs to sponsors.
There are 2 elements to configuring your Google Search: The Search Bar, and the Search Results. Configuration is done through your Google AdSense, and additional tweaking can be done at the code level:
- For this example, Create a page on your WordPress site called ‘Search’
- Login to your Google AdSense account. Select the ‘AdSense Setup’ Tab.
- Select AdSense fo Search.
- Select ‘Only sites I select’ under Search Type.
- Enter the URL of the sites you wish to include in your search results. If you maintain multiple websites and want results for all of them displayed, you can customize those options here.
- Select other options such as keywords, language, etc. and click ‘Continue’
- Select the look and feel of the search bar. By default the selection has the Google text within the toolbar text area. If you select another optional appearance, you can change the background to match the background css of the area you place the search bar later. Just select the one that closely matches your website for now.
- Select Text Box Length, and click “Continue’.
- Now you can select where you want your search results to appear. I recommend ‘Open results within my own site’ and enter the address of a page you’d like to use for search, i.e: ‘http://www.inforats.com/search’
- By default, ‘Enter width of search area’ is set to 800px. If your content area is smaller than 800, you can change this later to fit your WordPress site.
- Select your add locations and then customize the results to match your website. The closer it is and more natural it appears will increase chances of clicks-throughs to displayed advertisements. Click ‘Continue’
- Check the radio button and name your Search Campaign. Click ‘Submit and get Code.”
Now you should have 2 snipets of code to drop into your site. The ‘Search Box Code’, and the ‘Search Results Code’.
Search Box Code. You can place this code in your sidebar in a Text/html widget, at the top of pages or posts, or any other widgetized area. On Inforats, the search bar is placed in the header-right widgetized area using the Genesis Framework and on the search page itself. If you selected one of the codes that use a background color, you can change this color to match your css by changing this line:
<div style=”background-color:#000000;color:#FFFFFF”>
Example, to make the google search background transparent:
<div style=”background-color:#transparent;color:#FFFFFF”>
Search Results Code. Go to edit your search page and drop this code in. The width or size set by default is 800px. You can adjust this by editing the following line:
var googleSearchFrameWidth = 800;
Example,on inforats, the width was adjusted to 625px to fit:
var googleSearchFrameWidth = 625;



