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…

search1 How To Add Customized Adsense for Search Block in Wordpress

…the result is this..

search2 How To Add Customized Adsense for Search Block in Wordpress

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”

step1 2 How To Add Customized Adsense for Search Block in Wordpress

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 2 How To Add Customized Adsense for Search Block in Wordpress

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 3 How To Add Customized Adsense for Search Block in Wordpress

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 4 How To Add Customized Adsense for Search Block in Wordpress

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

step 5 How To Add Customized Adsense for Search Block in Wordpress


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 6 How To Add Customized Adsense for Search Block in Wordpress


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 7 1 How To Add Customized Adsense for Search Block in Wordpress

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.

step 8 How To Add Customized Adsense for Search Block in Wordpress

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:

pixel How To Add Customized Adsense for Search Block in Wordpress
If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , ,

About the Author

Brian Wong is a serial entrepreneur, Internet marketer and social media marketing expert. Brian helps individuals to succeed online through social media marketing, blogging and online marketing.

35 Comments

Vidal AponteNo Gravatar

22. Oct, 2008

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

Brian WongNo Gravatar

23. Oct, 2008

Go to your WordPress Dashboard and select “Write”, the choose to write a new page instead of a new post.

GeorgeNo Gravatar

23. Oct, 2008

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?

Brian WongNo Gravatar

23. Oct, 2008

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.

MARONo Gravatar

24. Oct, 2008

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!!!

MARONo Gravatar

24. Oct, 2008

Actually what I meant with the comment above was if you could do reviews. E-mail me…

gaborNo Gravatar

04. Nov, 2008

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

gaborNo Gravatar

04. Nov, 2008

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…

Brian WongNo Gravatar

04. Nov, 2008

Glad you worked it out and thanks for sharing the solution.

Shantanu GoelNo Gravatar

07. Nov, 2008

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.

Doug SmithNo Gravatar

14. Jan, 2009

Great idea! After a hack attempt on my blog where the hacker entered a malformed sql query into the WP search box I looked for other search ideas. The bug that allowed these hacks was fixed long ago but I felt uneasy that people were still trying. This idea allowed me to remove the WP search widget and monetize at the same time.

Thanks again!

[...] How To Add Customized Adsense for Search Block in WordPress This tutorial will show you how to add a customized “Adsense for Search” block on your WordPress Blog, adding a different avenue for creating income. [...]

[...] How To Add Customized Adsense for Search Block in WordPress This tutorial will show you how to add a customized “Adsense for Search” block on your WordPress Blog, adding a different avenue for creating income. [...]

[...] How To Add Customized Adsense for Search Block in WordPress This tutorial will show you how to add a customized “Adsense for Search” block on your WordPress Blog, adding a different avenue for creating income. [...]

[...] How To Add Customized Adsense for Search Block in WordPress This tutorial will show you how to add a customized “Adsense for Search” block on your WordPress Blog, adding a different avenue for creating income. [...]

[...] How To Add Customized Adsense for Search Block in WordPress This tutorial will show you how to add a customized “Adsense for Search” block on your WordPress Blog, adding a different avenue for creating income. [...]

VivBountyNo Gravatar

15. May, 2010

Hi Brian,
I successfully put Adsense for Search on my Travel Blog here: http://safaritosuccess.com/travelblog. So I got brave and tried to put in on my pet blog, and when I test with the few simple posts on my blog, the key words I use, which I know are in the posts, are not pulling any of my posts up on the search results. Can you advise?
I love your tutorial style. Very easy to follow. I am learning from you sir. Prosperous Blessings, VivBounty

Brian WongNo Gravatar

15. May, 2010

Chances are, Google has not yet indexed all your pages if its a new blog. Two things you can do:
1: do a site search on Google by typing “site:www.yourpetblog.com” (enter your pet blog url) and see what pages are indexed by Google.
2: submit you sitemap to Google using the Google Webmaster tools

Hope that helps.

adsenseNo Gravatar

17. May, 2010

This is great brian wong .. you help me and save my time, I have already setup a adsense ads but dont know how to setup search box. very informative for adsense user like me.

VivBountyNo Gravatar

18. May, 2010

Thanks so much, Brian. I wil take your kind advice and let you know what happens. Need to ammend some things before generating sitemap.

Kindest Regards
VivBounty

CathalNo Gravatar

02. Sep, 2010

I followed your very well explained directions, Brian but I’m afraid I fell at the final hurdle which was: “You should update your .htaccess now” after I changed the permalinks.

I’m a bit of a newbie so I have quite a bit of work to do before I can avail of your advice.

Thanks anyhow.

pilotHansNo Gravatar

07. Sep, 2010

hi, I’ve followed the above but I can’t get it working. is there any php page or java script that i need to add besides the Search Box Code ,
Search Result code?

I’ve also posted my problem in http://wordpress.org/support/topic/google-search-button-showing-400-bad-request-illegal-filename?replies=1

hope u can advice. thanks

JohnNo Gravatar

20. Oct, 2010

@gabor. Thanks so much for figuring this out. I mucked around with it for ages unable to figure out how to add it to my site…but changing where the ads display fixed it.

registry cleanerNo Gravatar

12. Nov, 2010

good information you

write it very clean. I am very lucky to get this tips from you.

ShivamNo Gravatar

28. Nov, 2010

Thanks :)
It helped.

Nice tips,,, thank you,,, hope i will get more earning with google

RobertNo Gravatar

18. Jan, 2011

This was extremely helpful. I have been trying to add the adsense for search box to my blog without much luck, just some technical issues, minor, but beyond me. Your tutorial was perfect. Too bad google couldn’t make it this easy.

ErsinNo Gravatar

20. Feb, 2011

Great Post! Really great post.

I was searching all day to find an easy way for this, and I couldn’t find any past which is more helpful than this one.

HeryNo Gravatar

02. Mar, 2011

hello..thanks..After i read this freat post of your blog i finally can add adsense for search in my blog..My adsense earning is still very small..I hope by adding adsense for search my earning will increase significant..:)
Regards..

gmanNo Gravatar

26. Mar, 2011

You should be responsible and caution people about doing this. Against the Google Adsense terms of service. You can only (last time I checked 2 months ago) have 1 link unit or 1 adsense for search on the search result page. I bet you all these people have regular ads all over the sidebar etc on the search results page. That’s a no no. You should caution people. It’s irresponsible to do otherwise.

LVWJNo Gravatar

23. May, 2011

I am trying to put the HTML code for Adsense Search, not Adsense content, on my WordPress website/blog. where do I put it? I pasted it to my primary widget area howver I don’t see it on my website. What do I do!?

Brian WongNo Gravatar

23. May, 2011

There’s two parts – the code fo the search box and the second part is the code for the results page. To put the search results inside your blog theme, then create a new page in WordPress and inside the content area, paste the HTML code fo the Adsense results.

jenny jacksonNo Gravatar

25. May, 2011

hello, i just want to add adsense custom search on my blog and fortunately read your tutorial about it. thanks. but how do we test it?

Brian WongNo Gravatar

25. May, 2011

Just follow the instructions in the post above. Create your adsense for search code, add the code for the search bar somewhere on your blog (normally the sidebar or header), add the results page code on a new blog page. To test, just type something in the search box to see the results.

[...] How To Add Customized Adsense for Search Block in WordPress This tutorial will show you how to add a customized “Adsense for Search” block on your WordPress Blog, adding a different avenue for creating income. [...]

Leave a reply