Not that it matters much, but I’m using the latest version as of June ’09 of WordPress 2.8.

Adding your Google Ad custom search code is very easy and will only take you about 2 minutes.

Just follow these simple steps:

First, create a new post in your blog and call it ‘Search Results’ or similar. If you are using an SEO plugin or you can control the ‘slug’ to this page call the slug ‘search-results’. If you are not using an SEO program you really should be, but never mind. The important thing is to make a note of this page URL and make sure that it is publicly accessible over the Internet. This will be the post where search results will be placed in to by Google and we will need to refer to it later.

Login to your Google AdSense account, select the AdSense Setup tab and then click on AdSense for Search.
adsense-search1

Next select whether you want Google to search just your site, a selection of sites (that you type in the box underneith) or the entire web. This can be whatever you like. I’m using only my website for search results. On the same page lower down are options to select the Site Language. Below that is a dropdown list for Your site encoding, yours will probably say Western – You can normally leave this is as it is. Next Select your ‘Country or territory for Google domain’

Now Continue >>

Select the look and feel – you can customise this later so don’t worry about deliberating which one to choose 🙂

Continue >>

Now this bit you will want to have a look at, where it says:

Opening of search resutls page, you will want to select Open results within my own site
adsense-search3

Where is says: Enter the URL where search results will be displayed enter a URL to your website. This is the URL for the page you created in WordPress in step 1 for Google’s search results (for example http://mywebsite.com/search-results or maybe http://mywebsite.com/?p=3)

Next tick the box that says “Your use of these AdSense for Search features is subject to additional terms. By ticking this box and clicking ‘Submit’, you are agreeing to these terms.”

adsense-search4
Now type a name for your search engine such as ‘my search’. Now click ‘Submit and Get Code’

OK.

This is the only bit that requires some thought but it’s very easy really. In the top box – This is the code to use for your search feature, simply copy the whole text into your clipboard.

adsense-search5

Now locate the file searchform.php. This file will be in your WordPress template folder, for example: mywebsite/wp-content/themes/mytheme/ searchform.php

Read searchform.php in with a text editor and just replace the whole thing with the code you copied from Google. Save this file and upload to your server.

Now copy the text from the bottom box, the text in the Search Results Code box – copy this to your clipboard.

Now edit the post that you created in WordPress earlier called ‘Search – Results’ and past in the code from Google here.

Now click Update Post on your blog. That’s it you’re all good to go.

Having Google search on your blog really does make a difference to your click through rate. Rather than having about 1% or people clicking through, you will find your CTR rising to about 50%.

Happy blogging

0 comments

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>