Sep
4th

Google Adsense for Search: Embed Results in WordPress

Thanks for stopping by my personal blog on Marketing Technology! Over 50,000 visitors a month find my content worth returning for, so don't forget to subscribe to the Marketing Technology Blog RSS feed or to the Marketing Technology Email to have new content sent directly to your inbox. You may also find my other business blog helpful, Social Media Domination.

Google AdsenseWhile I did quite a bit of template work on WordPress this weekend, I saw a note about embedding your Google Adsense for Search results within your Search Results page. This is pretty simple if you have a static website, but working within WordPress it’s a little more difficult. Thankfully, Google did a nice job (as usual) with writing some nice clean scripts to embed the results.

I simply edited my “Page” template and inserted the code that Google requires for the landing page. I have the search results posting to my search page (http://marketingtechblog.com/search). Then, I updated my Search page with the search form (with some minor edits of course).

The script that Google supplies is intelligent to only display if there is a post result, so my other pages do not display anything. I suppose I could have wrote an ‘if statement’ that only displayed the results if the page equals the search page. However, I didn’t bother since it won’t display otherwise. I suppose it’s a little bit of a hack and not proper, but it doesn’t hurt anything.

My next step was to ensure that no competitors to my employer showed up on the search results! I hope I got them all!

Try it out here.

RSS feed | Trackback URI

Comments »

No comments yet.

Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

My Comment Policy: I moderate comments. Please be patient:

  • Spam will happily be destroyed.
  • Use your real name, not some keywords. Otherwise it will be destroyed.
  • Mean comments aren't necessary. If I don't post them I will reply personally to let you know why.
  • Lewd comments will be edited, I don't want my readers leaving because of offensive content.
Great debate, criticism and colorful commentary is always appreciated and approved!