Well if you notice that my blog’s default search box has been replaced with Google Adsense for Search box. And if you search for anything, results are shown right in my blog and not on Google page. How to do this?
Well so I am writing a guide on how to achieve this. This guide will work for any wordpress template and across almost all wordpress versions.
Steps to add search page in your blog:
- Login to your Adsense account and go to ‘My Ads’ and then click on ‘Search’ and then select ‘Custom Search Engines’.
- Now click the +New Custom Search button at top. You will see the following screen. (I have expanded all the possible options – click the image to enlarge it)
- Now fill in the options. Since you are creating it for your blog/site, select the option ‘Only sites I select’ against ‘What to search’ option. Select other options as suited for your site.
- Don’t forget to add a custom channel for your search box so that you can track its performance later on.
- Select proper style for your search box on the page. Also make sure Ad style matches and blends well with your site’s theme because the that style will be used on the ads displayed on the search page.
- Now under the Search results option select ‘on my website using an iframe’ checkbox where Display results: is shown. This will ensure that results are displayed on your site only and visitors don’t have to leave your site during the search operation.
- Now create a page on your wordpress blog/site named ‘Search’ with the slug ‘search’ and enter that page’s url in the box where it says ‘URL where search results will be displayed’. It is not compulsory to use the page slug/name as what I am using. You can use it whatever you want.
- Leave the width of the search results page as 800 as the search results are displayed best in that width. Since my blog’s design didn’t have that much width initially therefore I dropped the sidebar on my search page by using a custom template to display my search page. You can experiment with lower width for the search page and test whether it works for you or not.
- After filling through all the options, click the final button ‘Save and get code’. Now you will see 2 codes are generated : Search box code and Search results code. Save both of them somewhere in a text file. Now your job at Adsense site is completed.
- Now go back to the page you created on your site in step number 7 and select HTML tab in write page page (if you had created the site/page in WordPress) and enter the both the codes you got in the above step on this page. Yes we will also display the search box along with the search results. This is because if the user does not get the appropriate results he can use the search box to search again. On my site it also serves another purpose that since I have turned sidebar off on my search results page I need to show the search button again.
- Now insert the ‘Search box code’ again on the template wherever you want to show the search code or in a Text widget which you can insert into the appropriate place.
- So that’s it. Your site/blog is running a google search box and will show you results from Google and even show your ads on the results page. If you have any doubts, ask in comments.
Note: This was an old post dated back in 2007 which I have rehashed and updated to work with the latest Adsense Dashboard design and on popular requests.
Permalink
Does this also apply if I use a wordpress template in blogger.com?
Permalink
I tried to implement the search code in my website http://www.magghu.com but no result is displayed. please help
Permalink
Nice post.. I tried in my blog WordPress 3.2 but seems not working….
Permalink
What error did you get?
Permalink
Thanks for the tip, but my search still isn’t showing up
Permalink
This is an old post but something to note is that Google custom search will only return results to what Google has indexed in it’s own index. So if there are no pages of your site indexed in Google you will get no results on your sites /search/ page etc., when using Google custom search. I ran into this problem myself but didn’t know why without a bunch of searching. Just a quick fyi.
Permalink
Great step by step tutorial. Worked like a charm. Thank you!
Permalink
Tutorial has been updated. It no longer needs any plugin. :)
Permalink
Can’t set it right, there’s no plugin that does this work for me?
(lazy here)
Permalink
Mighty search plugin is unavailable!
Permalink
Thanks for the headup. Will rehash this tutorial and repost it with new method. :)
Permalink
Good article. I tried your stuff, it shows up my page but there is no search content from google. Need Help!!!
Permalink
Great Article! BTW I tried using your search box on this page and it doesnt find any results for “MightySearch”
Permalink
Great article and great plugin.
I am gona install it to my blog.
Thanks buddy for sharing.
Sarfraz
Permalink
I am afraid that my Adsense – which seems to have changed the Search for Adsense page – does not follow the options you have specified after #1 tip. Would you consider writing a new set of instructions for the new Adsense? Thank you!!!
Permalink
Hey thanks for the tip. Got this post via Google Search. Will implement this tomorrow.
BTW where your Google AD’s are gone? :O
– mrintech
Permalink
Wow, thanks.
I have been wanting to do this for a while and you tutorial was easy to follow and spot on.
Many Thanks
Dan Collins
Permalink
Never mind, found it.
Permalink
I am not seeing where you can control the “page slug”?
Permalink
Check Step no. 4 and 10 to check what you can choose for your page slug.
In latest wp, page slug can be edited by clicking edit beneath your post title bar in write page.
Permalink
:D Excellent instructions. Worked perfectly. Thanks!!!
Permalink
More about adsense. I received an exciting email yesterday from Joel Comm and I couldn’t wait to share it with you. Joel has just released version 4.0 of his famous Adsense Secrets guide. This guide has been selling for $97 for the past few years and has been the #1 top-selling guide on Google Adsense. Well, Joel is releasing it at an attractive $9.95. This is a no brainer investment. To take advantage of this deal, just go to: http://www.imondayblog.com/goto/as4.html
Permalink
I wonder if modifying the search form Google provided is against AdSense TOS or not, can you give any info about that?
Baris Unver’s last blog post..Tayyip’in bilgisayarı
Permalink
input name=”sitesearch” id=”ss0″ type=”radio
input type=”radio”
Permalink
I can`t find this code in my template
to change it to
I`m using “i3Theme 1.6” theme
Any tip
Thanks
Permalink
very nice. I am going to link to this page from my blog.
Permalink
Good trick. I will be implementing this soon in my blog. :grin:
Permalink
Awesome, and I’d do this…if I didn’t get banned from them A LONG TIME AGO. Adbrite is better, anyways. Thanks for keeping us updated!
Permalink
Check whether you have exluded pages from google index? Check your header.php and robots.txt for this.
Permalink
Hi
I’ve managed to include the searchresults in my blog (not perfect yet but I will fix it later) My problem is that when I use the search function for the blog, it doesn’t not search in any of the pages. Maybe because they are in the database? Hope you have a tips for me :smile: Thank you!
best regards Erik
Permalink
This is my first post
just saying HI
Permalink
Permalink
Permalink
Dang.. I was going to blog this too. But it seems you have already blogged it he he :wink:
Permalink
No problem. BTW you are not on mybloglog.com? I am sure you are missing a lot by not being on mybloglog.com!