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 Adsense Setup and then select Adsense for Search. Choose Single page as it is easy to track your changes on a single page.
- Select Search type Google Websearch + Sitesearch and include your blog’s main url in the box.
- You can either keep the google logo, but I would suggest removing it. Use Google Search on button option to remove google logo.
- Now come down to Opening of search results type and select Open results within my own sit. Enter your site’s url and then select width as something related to your blog’s theme. For example for my blog I keep it 500. Now in the field Enter URL where search results will be displayed don’t enter your blog’s main url but enter something like http://yourblog.com/google-search
- Customise the colors according to your blog theme
- If your blog is not about porn, select Safesearch option as well. You should add a new channel to track your earnings better.
- 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 download MightySearch wordpress plugin. This plugin is just made for inserting google search results in your blog.
- Install the plugin and visit Options>>Mightysearch and input searchbox code and search results code in to the text boxes provided.
- Now create a new page named Google Search and make sure its page-slug matches the search url created in step 4 above. For example in step4 I mentioned the url http://yourblog.com/google-search so while creating a new page, enter page slug as google-search
- Now while creating this page, leave everything blank, select Code tab in write page page and enter
- So this has completed the job of integrating google search box in your blog. To remove the checked mark to your site instead of web by default, in your search box code find line
<input name=”sitesearch” id=”ss0″ type=”radio” />
Remove word checked from this and insert into the second <input type=”radio” /> line.
<!–mightysearch–> – to call both search form and search result on the page <!–mightysearch_form–> – to call only search form on the page <!–mightysearch_result–> – to call only search result on the page
Tip to replace search box with google box: You can remove all tables code to implement it better. Above code is valid if you are using the page to search via google. But you want to replace default search box with google search box. So open your file where search form exists. For example in my theme, code was in header.php Find <form> tag. Remove the entire code between <form> and </form> including these 2 tags. Now enter their the search box code provided by google. And then for step 11 enter <!–mightysearch–> to your google-search page to display only search results since search box is already in place of your default search box.




Great Article! BTW I tried using your search box on this page and it doesnt find any results for “MightySearch”
Great article and great plugin.
I am gona install it to my blog.
Thanks buddy for sharing.
Sarfraz
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!!!
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
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
Never mind, found it.
I am not seeing where you can control the “page slug”?
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.
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
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?
input name=”sitesearch” id=”ss0? type=”radio
input type=”radio”
I can`t find this code in my template
to change it to
I`m using “i3Theme 1.6″ theme
Any tip
Thanks
very nice. I am going to link to this page from my blog.
Good trick. I will be implementing this soon in my blog.
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!
Check whether you have exluded pages from google index? Check your header.php and robots.txt for this.
Hi
Thank you!
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
best regards Erik
This is my first post
just saying HI
Dang.. I was going to blog this too. But it seems you have already blogged it he he
No problem. BTW you are not on mybloglog.com? I am sure you are missing a lot by not being on mybloglog.com!