Love The Way I Work

Google AdSense for Search on WordPress

in Adsense/Google/Tutorial by

When Google let users add AdSense for Search results on my own site, I tried to install it. I want to keep elements like the header, footer, and site navigation panel the same for the search results page I create. You should try this new feature to your wordpress.

To use it, just choose the “Open results within my own site” radio button when you’re generating your AdSense for search code. You’ll also need to identify the page where you’d like to display your search results.

Google will give you two sets of code: one for the search box, and one for search results. Place the first set on a page where you’d like the search box to appear, and the second set on the page you’d like the search results to appear. Whenever users perform searches on your AdSense for search box, they’ll be directed to the page on which you placed the search results code.

It’s sound so easy. I just tried it and I couldn?t get it to work on my blog πŸ™ What is wrong? Therefore, I search to find the solution of my problem. I get a solution from macstansbury for my problem. Thanks for your tutorial.

Here are steps to install Google AdSense for Search on WordPress:

  1. Create a new page named “Search Results,” or something similar.
  2. Put your search box code in your sidebar or wherever you decide. I put this code in searchform.php and call this function on my sidebar.
  3. Set up the search to point to the page your created.
  4. After you put the Search code where you want it, do a search for anything.
  5. The result page you get will have no results. For some reason, any header javascripts interfere with the Search code. I think this is a main problem. Let’s fix this problem.
  6. Create a new page template in your theme folder. The theme would start with this as the first line:
    <?php
    /*
    Template Name: Google Search
    */
    ?>

    Feel free to named this template.

  7. Upload this to your theme folder in a moment, after you’ve titled the file googlesearch.php and saved it.
  8. Go to the search page you created (the one I named “Search Results”), and get the HTML for the page. You?ll need to copy it and paste the actual code into your googlesearch.php file. Look through the code, and take out any javascripts in the <head> section. Also take out any of the admin code, such as the one for editing the page. You’ll need to take out any javascript-dependent elements from your page, as well. I take out sidebar code, because Google Search result will overlap my sidebar πŸ™‚
  9. Save your googlesearch.php file, then upload it in the same folder as the theme you’re using right now.
  10. Go into edit your search results page and change the Page Template to “Google Search” (or whatever you named the template) and save the page.
  11. Well done! You’ll get get the results I get!

Try search something on my blog just for test.

πŸ˜€ Gud lak

10 Comments

  1. I tried the search from my page creator pages. It’s not showing the search and button properly..it is screwing up the width and hight also it showing some unnecessary borders…did u try in page creator..? Do you know how can i increase the width n length of the each layouts?
    Thanks in advance,
    Rathna

  2. Hi Andriansah,

    You can make addition page:
    – copy page.php into seach.php from your current template.
    – edit some parameter for header, footer, etc.
    – put your search.php into root directory.
    – copy your google search result code into search.php
    – that’s it

    If you still confuse about it. Please email me. I can do it for you πŸ˜‰

  3. To get repeat visitors to a site that site should contain unique content to that site.That’s the identity of site.If not users thinks this is duplicate one and they never continue to visit sites.Also there is lot of ways to repeat visitors to a site.site navigation should easy and easy to read is important.. More visit: http://bucks4you.blogspot.com

Leave a Reply

Your email address will not be published.

*

Latest from Adsense

Go to Top