Show AdSense Search Box in WordPress
AdSense Search Box is one of the features offered by Google’s AdSense. It will look like normal search box and the visitors can search for things in it. If the visitor clicks on Ads inside the search result, we will get the revenue. AdSense officially states that they allows up to two search box’s per page.
It offers two main options, first one is showing search result in a google page and second one is showing search result with in our site’s page. Its better to show search result within our site’s page , as we won’t lose the visitors. This article is will help to add and customize the search box to your WordPress site and show results with in it.
Step 1: Creating a “New Page” for Showing Search Result
The first thing to do is to create a New Page for showing the search result. For this go to your WordPress dashboard, Pages >> Add New >> and create a page with title “Search” (you can give any name, but it better to give search related title). Then click save with leaving the content area blank.
Step 2: Creating Ad Code for AdSense Search Box
In on of my other article I had covered this portion with screen shots. So not repeating here, You can check that post (link given below) and comeback here. And note one more thing, there’s one filed for showing search result, in which add the URL which created on Step 1.
Check Here: Setup AdSense for Search to increase Earnings
I think you guys got your code’s following the above link. If you not got the codes, you can create on by login in to your AdSense account then click on My Ads >> Search >> Custom Search Engines >> then click on “New custom search engine”. After creation you will get two ad codes like below.
Step 3: Adding Search Box Code to WordPress Theme.
In the two codes which you got from the above step, the first one is to display AdSense Search Box in your site. So you have to add that code in to the place where you want to display that Box. You can see the example in this website’s right side bar. For this login to your WordPress dashboard, then Appearance >> Customize >> then click Widgets. The add a “Text” widget to the place where you want to show it and simple copy paste the fist code in to it and click save.
After saving the customization window check your website, you can see the Google Search Engine Box appeared on that place.
Step 4: Adding Search Result Code to WordPress Page.
Now we have to add the search result code, which is the second code we got in Step 2. As we choose the option to show the search result with in our page, we have to add this page to that particular page. So open the search page in Editor window, which we created earlier on Step 1. The click on Text and add the second code in to it and click Update.
That’s it the Search box is ready to show the results with in your site. Just visit your site and search anything in that search Box and check the result showing with in that search page.
Is this article helpful to you or did you found any difficulties while customizing or adding codes ?? feel free to ask the queries. The comment box is open for you.