• Home
  • New Entries
  • Popular Entries
  • Submit a Story
  • About

Use Adsense for Search in your Wordpress Search ...

I’ve been trying to use adense for search since I changed my themes several times already in just a few months but I was not successful not until now.  

Steps to add search page in your blog:

   1. Login to your Adsense account and go to Adsense Setup and then select Adsense for Search.
   2. Select Search type Google either Site search or the entire web. Of course I choosed Only sites I select then add add my website in the selected sites box since I only want to search within my website.
   3. Customize your adense for search. I normally use the default settings.

      In Wordpress 
   4. Make new blank page in Wordpress and name it anything you want (lets use google-search for example) then save it.
   5. You will now have this link: http://yourwebsite.com/google-search take not of it.

      Back to Adsense
   6. Proceed now to Search Result style and look for Open results within my own site then check the radio button. Then enter http://yourwebsite.com/google-search in the box provided.
   7. Finish up your customization adn get your Google Adsense Code for search. You will get code for the search form and for the search result. Save it for later use.

      back again In Wordpress
   8. Now download MightySearch wordpress plugin and activate it. This plugin is just made for inserting google search results in your blog.
   9. Copy your adsense for search code in their corresponding box in MightySearch Plugin settings.
  10. Edit the page you recently made (google-search) then choose HTML instead of visual and paste this code: <!–mightysearch_result–>

      the hard part
  11. Now go to your wordpress theme you are currently using then open and edit header.php
  12. Look for tha part: <form method=”get” id=”searchform” action=”<?php bloginfo(’home’); ?>/”>
  13. Replace the action part with the code you got from google. (eg. <form method=”get” id=”searchform” action=”http://yoursite.com/google-search” id=”cse-search-box“> )
  14. after the <div id=”search”> tag, add the following similar to this:
      
      <input type=”hidden” name=”cx” value=”partner-pub-your adsense id” />
       <input type=”hidden” name=”cof” value=”FORID:11″ />
       <input type=”hidden” name=”ie” value=”ISO-8859-1″ />
      <input type=”text” value=”Enter search keyword” onclick=”this.value=”;” name=”q” id=”s” />
      <input name=”sa” type=”image” src=”<?php bloginfo(’template_directory’); ?>/images/searchbutton.png” value=”Search” class=”btn”  />  

      ==== Here’s the original code from the theme ====
      <form method=”get” id=”searchform” action=”<?php bloginfo(’home’); ?>/”>
      <div id=”search”>
      <input type=”text” value=”Enter search keyword” onclick=”this.value=”;” name=”s” id=”s” />
      <input name=”" type=”image” src=”<?php bloginfo(’template_directory’); ?>/images/searchbutton.png” value=”Go” class=”btn”  />
  15.  Save your header.php then try now using search.

You will notice that you have google-search title in your page navigation. You can try to unpublish or make the page private so it won’t show on your page navigation but the adsense for search might not work. You can try these steps that worked for me.

   1. Edit google-search page title to blank (remember, only the title and not the link. You can also add space if it does not save)
   2. Set the google-search page order to the last so it will not affect the positioning of the other pages.
   3. Save it and you are all set.

 Original Source:
http://toomuchfew.info

AddThis Social Bookmark Button

Posted at 02:16:50 pm | Permalink | Posted in Adsense  How to Blog  Wordpress Tips  

Related Stuff

Google Buzz Button Wordpress Plugin Released

If you are looking for a Google Buzz button to add into your Wordpress site then we have released the first Wordpress plugin exclusively ...

Plug And Play Ecommerce With Wordpress Plugins

Since 2003 Wordpress has slowly been gaining popularity amongst the elite of the internet, the bloggers. It is one of those few things ...

Add Google Search to Your WordPress Blog

The native WordPress search does not return very relevant results, thus it makes a lot of sense to add Google Search into your WordPress ...

Add More Sidebars to Your WordPress Theme

You can add more than one sidebar section to your WordPress site. For example, with the stc-intermountain.org site, I added a whole bunch ...

Series Posting in Wordpress

In my functions.php file, I have some code which implements series posting. This relies on the thematic ...

Top Stuff

Free Blogger templates Anime Themes

Wordpress Guestbook Generator Plugin

48 Unique Ways To Use WordPress

GeekLog

WordPress Single Post Templates

Get The Image WordPress Plugin



About Webloglines

Webloglines is a project offers a comprehensive collection of blogging services, articles, themes and plugins from around the world. Whether you're looking to promote your own blog or find blogs on various topics, this site is for you.


Search


Topics

  • Adsense (12)
  • Blogging Tips (73)
  • Blogs Slides (25)
  • Blogs Websites (22)
  • Digg (20)
  • How to Blog (129)
  • Search Engines (9)
  • SEO (135)
  • WordPress Plugins (269)
  • WordPress Security (75)
  • Wordpress Themes (99)
  • Wordpress Tips (162)

© 2006 www.webloglines.com. All Rights Reserved. Powered by IRange