Enter your email address:


Delivered by FeedBurner
Nov
5th

Add Google Adsence Search Results in Wordpress

Author: admin | Files under Tutorials

I will tell you how to add Google Adsnese Search box and Search results in your Wordpress blog. This is difficult to do. I have searched on Google forums but nothing. So i decided to make a tutorial and give you instructions how to make Google Adsense search results page.

1. Creating a new page template

First it is necessary to create a separate page. Copy (download) your page.php from your theme (let’s say default template) folder to your computer and rename it. I named it googlesearchresults.php. Open it with DreamWeaver or text editor and add a code (the one you see in picture at the top) before <?php get_header(); ?> equally you see in picture. See an example.

Add a code at the top
Add code before <?php get_header(); ?>.
Then save the file googlesearchresults.php. Every theme is different so every time you try adding results code into your theme steps may be a bit different. Now you need to add Search Results Code. Copy code from Google Adsense account and paste it below </div><!– post_header –>. Just remember that you do not need to edit anything else in the googlesearchresults.php file.

Add code below </div><!– post_header –>.
Now it is time to save this file. After saving upload it into your WordPress theme folder. I will not tell you how to add search box code because it is simple. Take a look at the next picture to understand where to add search results code. I just give you an example how it looks in my situation.

Code before <div class=”entry”>.

Search results code should be between </div><!– post_header –> and <div class=”entry”>. Looks like we are done here. Go to next step.

2. Creating a new Google Search WordPress Page

Now we need to create a new WordPress Page using the WordPress Page template (googlesearchresults.php) to display Google search results.

1. At Wordpress admin panel go to WRITE and then click WRITE PAGE.

2. Type search results for the page title and leave blank for the page content.

Search results page

3. On the right, expand Page Template: and select “google search results” (googlesearchresults.php).

4. Make sure the Post slug is “search”.

Page Slug and page template

5. Now Save the WordPress page.

3. Insert Adsense search box code into WordPress template

The last step is to insert Adsense search box code into your template if you have not done it yet.

Your are finished. Now you can test your Google AdSense search and see the result at http://www.YourDomain.com/search

Demo here.

Useful plugin that can help you.

Related posts:

  1. Easy way to add Google search results code in WordPress template
  2. Increase Google Adsence clicks
  3. Add an archive page in Wordpress menu bar
  4. Professional Wordpress layouts
  5. How to float text around the image, google ads and other things?
en_quibids_ipad_300x250_18

2 responses. Wanna say something?

  1. AM Win
    May 18, 2009 at 19:50:42
    #1

    Thanks a lot, your article really help me out.

1 Trackback(s)

  1. Mar 17, 2009: Easy way to add Google search results code in WordPress template | Blog and SEO tips to help you make money blogging

Post a Comment