Adsense inline with WordPress blog posts

I was reading this book about optimizing Google’s Adsense (What Google Never Told You About Making Money with AdSense!). In it, Joel Comm describes how he went from $900/month in Adsense revenue to $15,000+/month! Oh, man! It was too juicy to pass up! One of the many things he talks about is integrating your ads into your site. You’ll have to read the book for all the details, but this plug-in should help.

So, I knew I wanted to put Adsense ad blocks in the middle of WordPress posts. I knew I could do it with some simple hacks to WP, but I thought it should be a plugin. It turned out to be remarkably easy to do, and it turned into my first WP plugin. Of course, I “sampled” lots of code from pioneers who went before me.

Adsense — in case you don’t know, is Google’s little advertising engine for non-Google sites. You know when you see Google ads on a site somewhere, and it says “Ads by Gooooogle” or somesuch? That’s it.

Google has some rules about how you place Adsense code on your site, though, and how many Adsense blocks can appear on a page (two?). I haven’t tried to accomodate these rules in this plugin yet. I probably will have to do that down the road. Caveat emptor.

The plugin [download] is pretty straightforward. Put it in your wp-content/plugins directory, then go to your Plugins configuration page and click Activate.

You’ll need to customize the Adsense code in the plugin itself. Look in the adsense.php file. In the first function there’s a block that says “Begin Google Adsense code”. You want to replace the lines between that line and the one that says “End Google Adsense code” with your actual adsense code provided to you by Google. Otherwise, you’ll be showing ads for me. :-)

Once you activate the plugin, you should notice a new button on your Quicktags toolbar. The new button is “Adsense”, and it works like “more”. Click it to insert the Adsense tag, and enjoy the newfound wealth. :-)

Here’s an example:

[Edit: sometimes I see the ads, and sometimes I don't. It's just Google's peskiness. You can view the source and see the ad code is there.]

Because of Google’s policy on multiple ad blocks per page, I recommend that you always place a “more” tag before the “adsense” tag. This way, users will only see the ad if they click the blog entry to see the full thing. Otherwise, you may have several uncontrolled entries on a page all showing the ads. And Google may frown mightily upon you.

998 Responses to “Adsense inline with WordPress blog posts”

  1. i have used the plugin but its not quite flexible since the plugin is fixed for one size… for future plugin update, i suggest you might include the option to have at least 3-ad unit options; so i can include 3 ads in the code; so when posting, you have 3 buttons and have a choice what ad to use, say ad1, ad2, and ad3.

  2. [...] Adsense Inline – inserts Google adsense in blog posts. [...]

  3. [...] Adsense Inline  – 在博客文章中插入Google [...]

  4. [...] Adsense Inline – inserts Google adsense in blog posts. [...]

  5. [...] Adsense Inline – 又一个让你轻松在文章插入Adsense的工具. [...]

  6. Cosmos says:

    Thanks a million

  7. Smile to you, all blogger..

  8. mahalto says:

    I have already using that adsense plug in. thanks a lot

  9. [...] Adsense Inline  – 在博客文章中插入Google [...]

  10. Karl says:

    Think you for the plugin,but Is it benifite for the new standard seo: laoding page speed?

  11. [...] Adsense Inline – 又一个让你轻松在文章插入Adsense的工具. [...]

  12. [...] Adsense Inline – 又一个让你轻松在文章插入Adsense的工具. [...]

  13. farllok says:

    I have already using that adsense plug in. thanks a lot

  14. [...] Adsense Inline – inserts Google adsense in blog posts. [...]

  15. [...] Adsense Inline  – 在博客文章中插入Google Adsense代码。 [...]

  16. [...] 里加入各种广告代码。Adsense Injection – 将Adsense代码随机插入原有文章中。Adsense Inline – 在博客文章中插入Google Adsense代码。Adsense Earnings Wordpress Plugin – [...]

  17. chatroulette says:

    google adsense inline earnings inc.

  18. pc oyunları says:

    Merhaba böylesine güzelbir konuda bizlere vermiş olduğunuz bilgiler için size nekadar teşekür etsem azdır bu güzel yazıların devamını bekler çalışmalarınızda başarılar dilerim

  19. [...] Adsense Inline – inserts Google adsense in blog posts. [...]

  20. [...]  Adsense Inline  – 在博客文章中插入Google Adsense代码。 [...]

  21. farros says:

    sorry, but I can’t find adsense button on quicktags toolbar. any idea where it is?

  22. [...] Adsense Inline – 又一个让你轻松在文章插入Adsense的工具. [...]

  23. DexuZz says:

    я так понимаю, здесь все пишут разную хрень.. вот и я по русски напишу ерунду!!!

  24. gencliknerde says:

    her daim thank ecnebiler.

  25. dattai says:

    coool

    Thanks alot

  26. onyenk says:

    i can try plugin……………..

  27. NetLog says:

    Yep Yeni ArkadasLık PayLasım Sitesi

  28. Chat says:

    Türkiyenin Sohbet PortaLi

  29. [...] Adsense Inline – inserts Google adsense in blog posts. [...]

  30. [...] Adsense Inline : 在博客文章中插入Google Adsense代码。 [...]

  31. Ha Ha Ha Ha Ha…………………..

  32. [...] Adsense Inline – inserts Google adsense in blog posts. [...]

  33. [...] Adsense Inline – 又一个让你轻松在文章插入Adsense的工具. [...]

  34. [...] Adsense Inline - Adsense kodlarını blogunuzdaki yazılara eklemek için kullanabileceğiniz alternatif bir eklenti. [...]

  35. Carol says:

    Thank you very much for yet another first-rate article. I am always searching for original WordPress tips to suggest to my readers. Thanks for creating this article. It’s exactly what I was searching for. Truly great post.

  36. Charles says:

    Is it possible to add adsense code at the begining and end of each article with this plugin?i dont want to manually insert adsense code in each and every post one by one,instead I’d like to have the ad sense appear in each and every post all in one touch instead.Thanks

  37. Paul says:

    Hello!
    I would like to know how to add adsense or bidvertiser on a wordpress blog. I must mention that my blog is hosted on Wordpress’s domain. I mean I don’t have the blog hosted somewhere else on my domain. I’ve seen ways to post adsense/bidvertiser for those kind of blogs. But how about the blogs on wordpress? Waiting for answer! Many thanks!

  38. [...] Adsense Inline – 又一个让你轻松在文章插入Adsense的工具. [...]

  39. [...] Adsense Inline – inserts Google adsense in blog posts. [...]

  40. [...] Adsense Inline – inserts Google adsense in blog posts. [...]

  41. ITechRoom says:

    Very useful plugin, thanks a lot for sharing.

  42. sem says:

    Is it possible to add adsense code at the begining and end of each article with this plugin?i dont want to manually insert adsense code in each and every post one by one,instead I’d like to have the ad sense appear in each and every post all in one touch instead.Thanks

  43. [...] 插件1、ADSense Inline   这个插件可以让你将ADSense的代码插入文章中任意位置。使用方法是将插件激活后,就能在撰写新文章页面的代码模式下看到一个<adsense>的代码插入键,再想要插入广告的地方插入代码即可。(其实这个插件不仅可以插入ADSense的代码,只要是 Javascript的代码都可以支持!) [...]

  44. Mirc says:

    thankx post good

  45. Cet says:

    thankx good

Leave a Reply