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”