August 15th, 2006
AdSense Search Results on Your Own Blog (Not Working for Me)
I’m not sure if you’ve heard it yet, but Google is now allowing the search results of your AdSense search boxes to open in a page on your own blog. But even after following the official instructions in the AdSense Help Center, I can’t get it to work on this blog. I’m getting a blank page for my search results:
I’m not sure whether this is a problem with the steps I took, AdSense, my browser (Firefox), my theme or WordPress itself (I haven’t tried it on a static site), but here’s how I tried to get things done. Hopefully, you can see where I went wrong:
- Logged into my account, went to AdSense Setup, selected AdSense for Search, then filled up all the required fields. I made sure I checked the Open results within my own site checkbox and filled the URL where search results will be displayed with “http://bloghelper.is-there.net/search-results/” (without the quotes).
- I created a new Page in WordPress named “Search Results” with post slug “search-results” to match the URL I entered at the AdSense Setup earlier. Then I created a new Page Template, which I filled with the code generated inside the Your search results code box at the appropriate location. Next, I made sure my new “Search Results” page used my special Page Template.
- Last but not least, I replaced the original search box code on my sidebar with the new code generated inside the Your search box code box.
Upon viewing the source of my Search Results page, I saw that the code was placed correctly, and running a few test searches showed that the search form seemed to be passing the necessary variables properly.
But it’s just not working for me, so I’ve rolled back to the old search box code. Help?
Update: It works if you create a static (as in non-WordPress) file for the search results instead. But that makes it difficult to fulfill the original purpose of the customised search results, i.e. blend with blog, since wp-blog-header.php isn’t, or rather, can’t be called (and thus, all our WP functions, themes, and plugins can’t be used). Any solution for this?
If you found this post useful, keep updated with future posts by subscribing to blogHelper (for free) through RSS or email.
















17 Comments
August 15th, 2006 at 1:11 pm
[...] Original post by blogHelper | Blog Tips and Guides. To read the full article visit: blogHelper | Blog Tips and Guides [...]
August 15th, 2006 at 1:40 pm
Lol… I hope not. The possibility better conversion rates look extremely tempting to me.
August 15th, 2006 at 7:30 pm
same problem here… wondered whether it was something to do with the width of the page or something
August 16th, 2006 at 12:57 am
[...] General Aug 16 at 3:57 am by tdh -Google recently started to allow Adsense users to offer search results through Adsense for Search on a page on your site, meaning that you’ll keep your visitors around longer which surely is appreciated. The official instructions are easy enough, but it seems that you need to put it on a static page, which somewhat cripples the use at blogs. [...]
August 16th, 2006 at 6:16 am
I shall blaspheme myself here by mentioning Movable Type – please don’t throw stones.
But this is one of the unsung advantages of Movable Type’s ability to publish static pages. You can still leverage the shared code for your look and feel while publishing the file statically to the server.
And it was a watershed moment for me when I realized I could use MT to publish JSP, PHP and ASP files allowing me to leverage code deployed to completely separate application environments.
August 16th, 2006 at 7:03 am
You can create a new page, and then create a new template with only the functions you really need on it. I see the problem with the wp-header, but you can stick that information you’d get in plain HTML.
How I got it to work was by stripping out some offending (to AdSense) javascript with a custom header. But it wasn’t WordPress, it was a strait php file, but I’m certain the WP install would do the same.
August 16th, 2006 at 9:12 am
[...] When Google let users add AdSense for Search results on your own site, lots of people tried to install it. I was reading discussions over at blogHelper and ProBlogger about how they couldn’t get it to work. Loving a challenge, I took to figure out how to do this. My results were mildly discouraging, but I did get it to work, just not how I hope Google will leave it. [...]
August 16th, 2006 at 9:19 am
Mild workaround found here: http://tinyurl.com/mk8sl
(my site, just a ridiculously long url)
August 16th, 2006 at 3:41 pm
Darren: I believe that it’s due to the nature of a dynamic WordPress page. If you use a static page, it works fine. Argh…
Bryne: Hehe, in this case, I’ll have to admit defeat in my WP evangelism. But truthfully, it is entirely possible to manually create a static page with the same template as my WP blog – with some uhh.. minor loss in functionality, e.g. recent comments in my case. So, the verdict: I’ll take WP over MT anytime.
P.S.: I still have blogs running MT, so no offence intended.
August 26th, 2006 at 8:48 am
It’s not so difficult to make it work integrated to your theme.
There are just a few steps to accomplish this.
Duplicate your theme’s achieve.php, replace the loop with Google’s code, and put in the beginning of this new file:
<?php
/*
Template Name: Search Results
*/
?>
Edit the page you’ve created and change the page template to Search Results.
I’ve removed the sidebars because it would be too wide, but it isn’t necessary if you don’t whant.
You can see it working in my blog (the URL in my name
).
August 27th, 2006 at 6:22 pm
Bruno: I did the same thing, but it didn’t work. Google seems to have updated their code though, so that might be it.
September 3rd, 2006 at 2:38 pm
I managed to get this to work on my Wordpress blog and I posted very detailed instructions on how to do this on my blog. Here’s the link if you’re interested:
http://innerblogger.com/wordpress/2006/how-to-display-google-search-results-on-your-own-page-in-wordpress/
There is still a problem with the width, but I worked around this by eliminating the sidebar from the results page and everything seems to work just fine. Any ideas for a more elegant work around would be welcome.
September 6th, 2006 at 11:36 pm
Thanks, but I’ve got it working already. I haven’t taken the time to implement it on blogHelper yet though.
September 9th, 2006 at 1:17 am
I wrote a simple tutorial for WordPress users to blend AdSense search result on WordPress blog.
September 9th, 2006 at 11:14 pm
Nice to get so much help. That’s three guides now. Thanks.
April 27th, 2007 at 7:38 am
Darren: I believe that it’s due to the nature of a dynamic WordPress page. If you use a static page, it works fine. Argh…
Bryne: Hehe, in this case, I’ll have to admit defeat in my WP evangelism. But truthfully, it is entirely possible to manually create a static page with the same template as my WP blog – with some uhh.. minor loss in functionality, e.g. recent comments in my case. So, the verdict: I’ll take WP over MT anytime.
P.S.: I still have blogs running MT, so no offence intended.
May 13th, 2007 at 1:41 pm
Darren: I believe that it’s due to the nature of a dynamic WordPress page. If you use a static page, it works fine. Argh…
Bryne: Hehe, in this case, I’ll have to admit defeat in my WP evangelism. But truthfully, it is entirely possible to manually create a static page with the same template as my WP blog – with some uhh.. minor loss in functionality, e.g. recent comments in my case. So, the verdict: I’ll take WP over MT anytime.
P.S.: I still have blogs running MT, so no offence intended.
Leave a Reply