Google Adsense for Search: Embed Results in WordPress
Douglas Karr at 10:47 pmThanks 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.
While 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.


No comments yet.