Home > AdSense, PHP, Wordpress > Setup Google AdSense for Search in Wordpress

Setup Google AdSense for Search in Wordpress

In this article we are going to setup Google AdSense for Search in Wordpress blog. It’s assumed that you already have a Google AdSense account which can be obtained easily from Google Adsense website.

Setup AdSense Ad Unit

Login to your AdSense account. Click on AdSense Setup tab. Find and click the AdSense for Search link, like the following:

01 Create AdSense for Search link

Now you are on the first page of creating AdSense for Search.

02 Creating AdSense for Search #1

On the first part of the page, select the Search Type whether you want users to search your site, a collection of sites, or the web.

Next, if you selected the Search Type to be Only sites I select, specify a site or list of sites to search across. These can be individual pages, parts of sites, or entire sites.

03 Creating AdSense for Search #2

Next, optionally you can add additional keywords to fine tune the search engine’s results and ads to match your site’s content. Specify keywords that describe the content and subject of your site.

At the more options section specify the Site Language, Site Encoding, Country or Territory, Custom Channel for reporting purpose, and Safe Search which will exclude sites which contain explicit sexual content from the search results.

Click Continue button to go the the next process. The next page for creating AdSense for Search will appear like the following:

04 Creating AdSense for Search #3

In this page, you specify the look and feel of the search form to be displayed on your site. You could also set the length for the search text box.

Click Continue to go to the next page.

05 Creating AdSense for Search #4

In this page, we are going to use a page on our own site to display the search results. So, we specify the URL of our search results page which we are going to create later. Please note the URL, for example http://yoursite/search-results, which means that we are going to create a new page in Wordpress and can be called by have that URL.

Next, specify the location on the advertising on the search result. In this example, we will place it on the Top and Bottom of the search results. This will depend on your theme layout.

Next, optionally, you can specify the colors for the search result page to match to your theme color scheme.

Click Continue to go to the next page.

06 Creating AdSense for Search #5

In this page you must agree the term and agreements by clicking the checkbox. Now click the Submit and Get Code button to get the code for your site.

07 Creating AdSense for Search #6

In that page, you are presented with two codes. That codes need to be placed on your site. The Search Box code is to be placed in a new widget that we will create later, and the Search Results Code is to be placed on a new search result page (remember the URL we defined in the previous step).

Create Wordpress Widget

Now go to Wordpress admin. We are going to place a Text widget to the side bar. Find it on the Available Widgets and drag it to the Sidebar 1 box.

08 Creating Widget

Fill the Widget Title for example “Search”. Then copy and paste the Google AdSense Search Box Code to the widget content. Click Save and Close when you are done. The new widget will appear on the sidebar of you site.

Create Wordpress Page for Search Result

Next, we need to create a new Page that will contains the search results provided by Google AdSense.

09 Creating Search Results Page

Fill in the Title page, for example Google Search Result. Paste Google AdSense Search Results Code on the body part of the page but this time you must select the HTML tab so that we can paste HTML and Javascript code to the page.

Please also check that the URL for the page is the same as the URL for the search result defined on the creating AdSense for Search step.

You may also adjust the width for the search result to match your template layout. This is done by editing the googleSearchFrameWidth variable.

When you are done, click Publish button.

Testing

Go to you Wordpress site. Please check the there will be a new widget which contains the Google AdSense search form. Try to enter a keyword and press the Search button.

10 Testing Search Form

Then a search results page will appear that looks like it is a part of your web site.

11 The Search Result embedded on your own site

Now you are ready to get revenue when someone click on the ad links provided by the search result.

Akhmad Daniel Sembiring

vITraining.com – Qualified IT Products, Outsourcing, and Services
Ligarwangi.com – Linux, E-book, Coffee, Gift, etc

  • Share/Bookmark
This site uses a Hackadelic PlugIn, Hackadelic SEO Table Of Contents 1.6.0.