How To Add Customized Adsense for Search Block in Wordpress
I just updated the blog I maintain for my son over at www.jdwong.com . And I took some screenshots to create a short tutorial for you.
This tutorial will you how to add a customized “Adsense for Search” block on your WordPress Blog to add another channel where you can earn income.
What this means is that when someone uses the search box on your Wordpress blog, the results will be a Google search results and has Google Ads on the site. For example if someone searches for “baby” on the blog…

…the result is this..

Notice the results appear within a page in my blog with all the theme and styling elements that is consistent with the site.
Here’s a step-by-step guide on how to do it:
Step 1: In your Adsense account, create a new “Adsense for Search”

Step 2: Under “Search Type” select “Only sites I Select” so that the search only returns pages within your blog. Under “Selected Sites”, type the URL of your blog. Leave the rest of the settings and click “Continue”

Step 3: In my case, I want a very discreet appearance so I chose the watermark version of the search box. I also changed the search box length to 20 so that it fits on my blog sidebar. Then, click “continue”.

Step 4: For the search results, I selected “Open results within my own site”, and I specified the exact page to display the result. For example, my son’s blog is at http://jdwong.com/blog and so I want the search results to appear here: http://jdwong.com/blog/search. We’ll be creating this page in the later steps.
Next, I changed the width of the display area to 550 pixels so that it will fit within the content area of my blog and not overflow to the sidebar.
For “Ad Location”, I chose “Top and Bottom” because the width is small and therefore I would prefer for the ads to appear only at the top or bottom.
You can also customize the color and style of the search results. I left them as the default.
Click “continue”.

Step 5: Click the checkbox to agree to the terms and conditions and give your Adsense for Search a name and click “continue”.

Step 6: You are now almost there. Just copy the two blocks of code for the search box and for the search results and head on over to your Wordpress admin panel of your blog.

Step 7: Create a new Page on your blog and call it “Search Results”. Make sure that the permalink address says “http://jdwong.com/blog/search” because this is the URL we specified in Step 4.
Now just paste the “Search Results Code” as the content for this page.

Step 8: Now all you have to do is to add the search box into your blog. I added it to the sidebar with the sidebar widget. Go to your Wordpress “Design” section and select “Widgets”. Add a “Text” widget to the sidebar, and paste the “Search Box Code” in the content area.

And that’s it! Congratulations! You’ve just added a completely customized Google Adsense for Search on your blog and can now earn money by showing relevant Google Ads to your blog visitors.
Technorati Tags: adsense
Popularity: 72% [?]
If you enjoyed this post, get all my latest posts delivered via my email RSS feed!






















Hello Sir,
Thank you for the information you have helped me alot. I just wanted to ask 1 question. In my blog, where do I go to create a new page?
Thank you very much!
Vidal Aponte
Go to your WordPress Dashboard and select “Write”, the choose to write a new page instead of a new post.
Hi,
I folloed all steps as you explained, But while testing the same I am getting 404 error page. what could be the probable causes?
Hi George,
Make sure that step 4 and step 7 uses the same page. The most likely cause of your 404 error is that the permalink to your search results page is different from the one you specified in Step 4.
Hello Brian my name is maro. I commenting because I want to know if you could do a commentaries for us on iPod items that we have. Please write to me as soon as possible. Thank you!!!
Actually what I meant with the comment above was if you could do reviews. E-mail me…
Hi,
Thanks for your article. I just ran into the problem that I can’t override the searchbox width of 795.
i have tried to do it by hand, but no avail.
i normally use firefox, but i managed to slip through with 500 px width on one occasion only.
Strange - anyone else experience the same thing?
Anyone else find a work-around?
cheers - thanks again!
GJ
I think I just answered my own question….
After some mucking about, I found that 795px is the minimum if you want ads on Top AND Right.
I tried Top and Bottom and 500px worked just fine…
Glad you worked it out and thanks for sharing the solution.
Hey Brian
Nice tutorial. Actually I just wrote a post a cpl of days ago telling ppl about how to add adsense for search to 404 pages here:
http://tech.shantanugoel.com/2008/11/06/make-money-out-of-nothing-add-google-adsense-for-search-to-your-404-page.html
But your way of telling things is quite easy to follow. Will link to your post from mine.