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.

688 Responses to “Adsense inline with WordPress blog posts”

  1. teli Says:

    Cool - thanks for writing this plugin, much appreciated. I haven’t tested it yet, but will let you know how it goes :D

  2. Jamie Says:

    The limit is three Adsense blocks per page. It’s in the Program Policies.

  3. abhi Says:

    Good work! I just installed it on my site and its working. Thanks a lot… :)

  4. Jamie Says:

    Phil, I was wondering if your plugin is open source. I would like to know before I edit it for another purpose. Please email me with permission if that is necessary.

  5. Marc Says:

    Many thanks! Very useful plugin! Works perfectly at www.macalua.com :)

  6. Debbie Says:

    Great little tool, worked like a charm!, Thanks!
    Is it possible to create a plugin like this for an RSS feed? I’ve been trying to find a way to make by RSS feed blend in with the page better.

  7. Alex Says:

    Great plugin! I am using it on both of my sites: TiVoBlog & RaianoFamily.

    Thanks!

  8. Darshan Jog Says:

    Hi! Thanks for this Plugin. Implemented it fine. But just one Question. Do I have to generate Adsense code with FRAME option enabled or without it.

    When I enable FRAME option & generate Code I can see ADs related to Blogs only.

    But, when I disable FRAME option while generating, I see only Public Service ADs & only sometimes an AD related to Blogs.

    Anyone can help me out? Please.

    My email darshanjog.jog@gmail.com

  9. Richard Prosser Says:

    Is there a way to display the ads. on every content page? I tried putting the tag in the default theme index.php but that didn’t seem to do anything.

    Thanks …

  10. Dave Says:

    Thakns very much for the adsense plugin, but when used with another custom quicktag with a form script it doesnt work, even when it’s not on the same page. Any ideas how to solve it?

  11. Richard Brown Says:

    Hi
    I have used the code sucessfully on one site www.abistudios.co.uk but seem unable to get it to work on any other sites.
    Can you help?
    Rich

  12. phord Says:

    Dave and Richard(s)… Sorry I’ve been out. Did you get your problems resolved with this plugin?

  13. Sean Says:

    Hi,

    Thanks for the plugin. Was easy to install but got one problem with it. If I press the Adsense button nothing happens at all, so I have to manually insert where I like the ad to appear.

    Any suggestion on how I can get the button problem solved?

  14. Frank Says:

    Nice job! Was wondering if you could adapt this to use non google, (as in my own customers) ads? I have three companies that might support my blog if I could run their ads. What do you think?

    cheers

    Frank

  15. Audrey Says:

    Hi….. I have a problem. I’ve installed this plugin probably a dozen times and even though I can see the ads in my posts I am getting this in the header of my dashboard.

    Warning: Cannot modify header information - headers already sent by (output started at /home/twotails/public_html/random/wp-content/plugins/adsense.php:114) in /home/twotails/public_html/random/wp-admin/admin.php on line 6

    Warning: Cannot modify header information - headers already sent by (output started at /home/twotails/public_html/random/wp-content/plugins/adsense.php:114) in /home/twotails/public_html/random/wp-admin/admin.php on line 7

    Warning: Cannot modify header information - headers already sent by (output started at /home/twotails/public_html/random/wp-content/plugins/adsense.php:114) in /home/twotails/public_html/random/wp-admin/admin.php on line 8

    Warning: Cannot modify header information - headers already sent by (output started at /home/twotails/public_html/random/wp-content/plugins/adsense.php:114) in /home/twotails/public_html/random/wp-admin/admin.php on line 9

    No matter how I edit the plugin, I get that. If I leave the and what you wrote in between, it’s fine. What am I doing wrong?

  16. Some guy Says:

    Check to make sure there aren’t any blank lines at the top or bottom of the plugin php file.

  17. Shob Says:

    hey,
    This plugin didnt work for me in 1.5, i can see adsense button and it does not intsert adsense,any suggestion(s)?
    Thanks for nice plugins by the way.
    SG

  18. Sean Says:

    Tried to reinstall the plugin several times, checked for blank lines and more … but it still doesn’t work 100%.

    My problems are:

    1. I can see the Adsense button in my admin area but nothing happen when I press it. So I have to add the manually in each post.

    When I add a ad, I get a blank line above it but /not/ below it, it can be seen if you click on any post on www.seansite.net. Tried to add a , but doesn’t help.

    All help is appreciated!

  19. Mike Hillyer Says:

    Hi There;

    A couple of edits on my part:

    1) I change the $tag value:

    $tag = “”;

    This made life easier as without the it was making my XHTML invalid.

    2) I increased the logic so that I would only see the ad on the individual post pages, except for the first post on the home page:

    /**************************************************************************
    ** All done! No more changes need to be made below this line! Enjoy! **
    **************************************************************************/
    if( is_single() )
    {
    return str_replace( $tag, $adsense_code, $data );
    }
    elseif ( is_home )
    {
    if ( get_option(’firstPost’) )
    {
    update_option(’firstPost’, FALSE);
    return str_replace( $tag, $adsense_code, $data );
    }
    else
    {
    return str_replace( $tag, ‘’, $data );
    }
    }
    else
    {
    return str_replace( $tag, ‘’, $data );
    }

    All I had to do was add update_option(’firstPost’, TRUE); to the home page before the post loop began. Now I get an inline ad for the firt post but not the rest, so that it along with my sidebar ad total two ads no matter now many posts on the homepage.

  20. phord Says:

    Shob: Does the [!–adsense–] tag get added when you click the button? And then the adsense doesn’t appear on your page? Or does the tag not even get added?

  21. phord Says:

    If the Adsense button doesn’t appear:

    The adsense button is added to the edit page with a Javascript function. You may have javascript disabled or you might have an overzealous popup blocker that’s blocking it. (But if javascript is disabled, none of the other buttons would appear…)

    Add this code to your wp-admin/quicktags.js file in the same area where you find the other edButtons entries (around line 24):


    edButtons[edButtons.length] =
    new edButton('Adsense'
    ,'Adsense'
    ,''
    ,''
    ,''
    );

    Sorry I haven’t been keeping up with the comments on the blog. I’ve discovered comment notification was broken in 1.5(!!) but I fixed it now.

  22. Sean Says:

    Thanks for the answer phord. I belive I got the same problem as Shob. I do see the adsense button, but when I press it the [!–adsense–] tag isn’t added to the post and therefor the adsense adv doesn’t appear on the page.

    So what I have to do is manually add [!–adsense–] to the post before I post it, and then the adsense adv. appear on the page.

    - So, the Button appear in the admin area but nothing happen when I press it.

    A second problem I got is that I get a blank line above the adsense adv on the page, but there are no blank line below, as can be seen here: http://www.seansite.net/thailand/bangkok/bangkok-downtown/

    Tries to add a to the script but to no avail. Got an idea how I can get that corrected?

    Thanks for a nice blugin btw :-)

  23. Dave Says:

    Hillyer:
    I had to make further changes to your code to get it working on my server.

    /**************************************************************************
    ** All done! No more changes need to be made below this line! Enjoy! **
    **************************************************************************/

    if( is_single() )
    {
    return str_replace( $tag, $adsense_code, $data );
    }
    elseif ( is_home() )
    {
    if ( get_option(”firstPost”) )
    {
    update_option(”firstPost”, FALSE);
    return str_replace( $tag, $adsense_code, $data );
    }
    else
    {
    return str_replace( $tag, “”, $data );
    }
    }
    else
    {
    return str_replace( $tag, $adsense_code, $data );
    }

    //return str_replace( $tag, $adsense_code, $data );
    }

    copied “update_option(’firstPost’, TRUE);” to the index.php file:
    ./wp-content/themes//index.php
    after the first div

  24. Dave Says:

    oops….

    copied “update_option(”firstPost”, TRUE);” to the index.php file:
    ./wp-content/themes//index.php
    after the first div

  25. phord Says:

    Sean: To add a blank line below the ad, you should be able to simply add it in the edit field in your comment. Or add a [p /] (with angle brackets) into your post instead. Or a [br]. Did you try these?

    The reason there’s a blank line before the ad is that WP puts text inside paragraph tags. And the default behavior of a paragraph tag [p] is to insert a linsepace after a paragraph, but not before. If you put your adsense ad inside a paragraph tag, the blank space should appear, I think.

  26. Mahesh Bhat Says:

    Wow! this is fantasitc plug-in… was really needed. Working great in my blog!
    Thank you very much.

  27. LcF Says:

    any plan to write a adsense plugin that support MULTIPLE ad format?

  28. phord Says:

    Re: multiple ad formats

    Yeah — but I’m not sure how to do it. Should I have mutliple Adsense buttons on the quicktags bar? Or should I have one and have a popup to let you choose which ad to insert? Or let you edit the tag manually?

    I’m going to use the new 1.5 features to add an option dialog to configure the plugin, too.

  29. Mahesh bhat Says:

    Hi Phord,

    I have no technical knowledge. But here is the few suggestion-

    All the multiple ad code should be inserted into adsense.php file. For each ad format different “adcode’ should be given… like, etc

    Whenever we post a new message we can select particular adcode and insert it into our message.

    Thanks

  30. Mark Krynsky Says:

    I got the plugin installed fine but the ads do not appear. If you view the source on my page you can see the adsense code, but there are also plenty of and tags as well. you can view this by going to my site at krynsky.com I’m a newb to WP and can’t figure out the problem. I’m running WP 1.5. Any help would be appreciated.

  31. Jeff Says:

    Hiya,

    Nice adsense plugin…any idea how to get it working with Adsense Gold tracking url, in the directions it says to ad after the AdSense script but i get a parsing error in the plugin when doing that ?

  32. ken1 Says:

    hello!!
    great idea for the plugin but should it work for WP1.5?
    cant get it to wrok on http://www.top-10-list.com/

    any ideas?

    greeetings !

  33. Nigel Says:

    Hi Phord

    This is great - works fine on my site. Thanks.

    Quick question: where is the plugin inserting the code? I’d like to modify it (with a div?) so that the page content wraps around the adsense. I’m new to PHP, so am slow at figuring this out!

  34. phord Says:

    If you put the DIVs around your adsense code in the script, it should work “as expected”. The HTML you insert there goes straight into your post.

  35. andufo Says:

    doesnt work for me. how do i activate the plugin in the frontend? no ads are shown. Should I invoke a function or something?

  36. andufo Says:

    in my case.. no button is shown, the same with de adsense tag.

  37. tinus Says:

    Hi Phord,
    thnx for sharing the wealth ;)

  38. Jack Says:

    Got the button to show. But when I click it, it only reveals the code itself on the blog. So, what you see is the actual code for adsense not the ad showing up???

    Any ideas?

    Thanks, Jack

  39. particle Says:

    It installs fine, inserts fine, but no ads. I seems to have tried everything but cannot get this to work. Any help?

  40. phord Says:

    Jeff: The error you’re seeing may be because the code you’re adding has single-quotes in it. The plugin uses those to mark off the code, so you need to quote them or change them. I can try to help if you email me the code you’re trying.

  41. phord Says:

    Jack: That’s pretty strange. Can you point me to an example of this happening?

    Particle: Do you get the “Adsense” button on your quicktags bar? If you click it, does it add the Adsense tag into your post?

  42. particle Says:

    I don’t see an email address so here is the code

  43. phord Says:

    The code didn’t show up in your post. Email me at phil-at-phord-dot-com

  44. particle Says:

    ug.
    sending

  45. John Coutts Says:

    In the index.php template (wp-content/themes/default/) put your AdSense code between the second and third tags. Your AdSense block will stay on top of every post:

    ==========index.php================

    ================================

  46. Kartik Says:

    Great work…fantastic plugin..You are a genius man!! I liked your plugin very much ..just what I wanted..

  47. Bob Says:

    Most excellent! Just what I have been looking for…..insalled with no problems.

    Thanks phord!

  48. Pheedster SEO Blog Says:

    Phord,

    Simply awesome I say. . .Simply awesome! :)

    I was always trying to add adsense to my posts but to no avail! :(

    The plugin worked the first time out.

    Thank you for your brilliance.

  49. Max Says:

    Great, I use it and it works fantastic. Thank you. I have summarised the steps I took to install this plugin here, as well as how I added search and other ads in the sidebar also.

    Now any clues on how to remove the two question marks? ??

    Thanks Max

  50. Aoteatech Says:

    Adding google adsense to wordpress

    Google adsense is making good use of the long tail. It’s now so easy (and free) to put advertisements onto your pages. Starting a blog and being interested in these sorts of things I decided to trial the service.
    After enrolling, confirming and…

  51. David Chin Says:

    Just what I need! Many thanks for your efforts and generosity!

  52. drazin Says:

    awesome plugin love it. check it out in use at www.dankster.org

  53. Johan Says:

    What a great plugin! Works excellent!

    For those who are having problems with the Adsense button above the post form (Adsense code not being inserted automatically): you might want to check if you have the WP-ContactForm plugin installed. The javascript for inserting the contact form tag, broke all my other plugin buttons.
    A simple workaround: uncheck the “Show ‘Contact Form’ Quicktag” checkbox on the contact form options page.

  54. Tony Zeoli Says:

    Johan,

    That bug fix was so easy, it’s not even funny. Can’t believe that’s all it is, just unchecking that box.

    The next step would be to somehow figure out a way to REMOVE the adsense code once you get to three on a page, so you don’t go over Google’s rules, forgetting that you have code in an older post. I don’t know how that can be done, but I’m sure somone will figure it out.

    Everyone’s problem was that you had to cut and paste the code in a new post, because of the bug…now, I’m sure people will be looking for ways to delete code in old posts without having to actually go into the post and remove it themselves.

    Tony Z.

  55. The Daily Sketch Says:

    Thank you, Johan. Unchecking the ContactForm Quicktag finally made the plugin work. Now it’s rockin’

  56. Kishore Balakrishnan's Blog Says:

    Kaizening the Adsense Plugin for WordPress

    » Adsense inline with WordPress blog posts — from the mind of Phord : …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…

  57. Darren Says:

    You rock! Excellent plugin, just what I’ve been looking for!!

  58. Post Says:

    The plugin is working thanks to your genius!

  59. MaxPower Says:

    I added this little tidbit of code to get the adsense block to float inline properly.

    <p style=”float:left;width:251px;padding:8px;
    border:0px solid black;margin-top:15px;
    margin-left;20px;margin-bottom:15px;
    margin-right:30px;”>

    [then the adsense code]

    </p>

    Check it out in use at MaxPower. Nice work making this into a plugin! Really usefull, would be very easy to modify the quick tag and plugin to allow for different style ads (I think).

    Cheers

    [edit: Fixed HTML markup to show up in the comment. You can find the author’s writeup of his changes here:
    Adsense for Wordpress — phord ]

  60. Online » Mejorar el rendimiento de adsense legalmente II Says:

    […] que he encontrado es uno que ya estoy utilizando, se trata de Adsense inline, un plugin de Philhord que funciona bastante bien, aunque se podrían hacer algunas mej […]

  61. shashi Says:

    hi
    thanks a lot..

    its working great..perfectly..

    plugin is perfect….

    thanks a lot..

    thanks
    shashi

  62. Richard Silverstein Says:

    I installed the plugin, activated it & see the adsense quicktag in the ‘Write’ toolbar. But when I type in text into the post box & then click “adsense” nothing happens. What is it supposed to do? I expected that it would insert my adsense code (which I did add to the plugin file). Am I wrong?

  63. Richard Silverstein Says:

    Johan is a genius. I too unchecked the Contact Forum box & adsense is now working. But unlike you, Johan, the Contact Form button had no effect on any of my other quicktag functions.

    Phord, might I suggest that you add this info to the file installation instructions. By my acct. at least 5-6 people in this thread had the exact same problema as I & if we had the problem then countless more who’ve tried to install the plugin have had the same problem.

    It’d save us all time & effort if we knew what the problem was right from the start instead of having to search through the forum & then come here to find the answer.

  64. George Duffus Says:

    I can’t subscribe to your blog. When I copy the link my aggregator, it say it’s not a valid URL.

  65. Darren Says:

    Great plugin but it doesnt work with the WP Contact form. When you deactivate the WP Contact form plugin the adsense plugin works.

    I could see the button but nothing happened when I clicked on it.

    I need to use the WP contact form so I’ll have to deactivate the adsense plugin unless anyone has a solution?

  66. Darren Says:

    Sorry unticking the box in the WP contact form didn’t work for me neither.

  67. phord Says:

    If the Adsense button doesn’t work for you, you can emulate it easily. It doesn’t insert your adsense code into the ad. Instead, it puts in a comment tag like this: <!–adsense–> (for those of you new to HTML, that’s a LESS-THAN, EXCLAMATION, DASH, DASH, adsense, DASH, DASH, GREATER-THAN.)

    If you just type that into your post, you should see the same effect.

    I’m sorry the quicktag button isn’t working for everyone. I’ll try to get something that will work universally in place soon.

  68. Leonieke Says:

    any ideas what plugins might mess up the adsense code?
    somehow I end up with all these lovely (not requested) br’s in my code

    I’ve turned off all textile-markdown-plugins, but the freeby br’s are still added (which in all my other posts I don’t mind)

    any ideas?

  69. Techtorials » Blog Archive » Adsense in WordPress Says:

    […] sense in WordPress I found some awesome WordPress plugins. It’s very easy to use! http://www.philhord.com/phord/adsense-inline-with-wordpress-blog-posts/ This entry was posted on Sunday, July […]

  70. Darren Says:

    Phord, an update..

    There appears to be a clash with the plugin intouch. When I deactivate the intouch plugin I am able to use the quicktag button. I think it also helps unticking the quicktage box on the WP contact form plugin options.

    Once you have clicked on the quicktag button, you can then reactive these plugins, until you need to add another adsense ad.

    Hope this helps a few people out.

  71. Mikhail Esteves Says:

    Nice work!

  72. Tech Dude Says:

    First of all, I am very new to php/blogging. I set up a wordpress blog on insurance and tried to use adsense. I came across the adsense plugin and gave it a try.

    It worked well … but I wanted something slightly different. I found editing index.php, single.php and archive.php gave me exactly what I want:

    1. Dispaly ads between posts (not as part of posts) both on the main blog, archives and categories.
    2. If a particular entry is clicked, the ad should be shown at the end.

    I thought this would be kinda popular requirement but could not find any ready solution. This is what I did (not very elegant but works and please do remember that in the php world I am 1 week old):

    This will display ads after the 1st, 4th and 7th post.

  73. Tiverton Wanderer Says:

    Hi, I’ve got a slightly strange problem on my blog, I’m using the default kubrick template with the latest version or Wordpress, when I insert the adsense tag into my posts it displays fine, however, the adsense adverts that were in my sidebar vanish! The ads under my posts only comprise of two ads, where’as the ads in the sidebar are a block of 5. Is there a way to keep both?

    Thanks for your help, hope you can help.
    [TW]

  74. Tiverton Wanderer Says:

    One other thing, sorry bout this…. if I post the adsense code to more than one post, it only displays on the first post in my blog. Stranger and Stranger….

  75. phord Says:

    Tiverton: I looked at your site. The Google Adsense code is getting inserted into your pages, but I don’t know why the Adsense blocks are not appearing onscreen. There must be some Google explanation for it. I’ll try to experiment a bit and see what it takes to get multiple Google ad blocks onscreen.

  76. Tiverton Wanderer Says:

    Thanks, always appreciated. [TW]

  77. Michele Neylon :: Pensieri » Article » Adsense for Wordpress - my version! Says:

    […] d investigate further. The original adsense plugin for wordpress isn’t full […]

  78. Michelle Says:

    Ok…. I am feeling very very stupid. I have downloaded the adsense.php plugin. I have put it in my wp-content/plugins directory.

    However, when I go to my blog and try to activate the plugin, its not even shown as an option.

    Does anyone know what I am doing wrong?

    Please help! Thanks so much.

  79. Wayne Says:

    Phil, don’t want to take anything away from your adsense plugin, but finding your plugin inspired me to take the concept further in the direction of what I was looking for in this type of add-on.

    Working from your idea and your code, I put together and have been using for a few months now, my AdSense-Deluxe plugin. It has a lot of cool features including definining multiple adsense blocks which can be referenced from posts by name.

    More info is available at: http://www.acmetech.com/blog/adsense-deluxe/

  80. Steve Farmer Says:

    Hi,

    your plugin causes RSS not to work anymore. Could you please let me know how I could fix that.

    Thank you,

    Steve
    http://www.GeekTavern.com

  81. broly Says:

    Ok, i edited the adsense.php file with my info. i uploaded it to the plugins directory, i see the button and it inserts the adsense tag in my post. However, no tags show up.

    http://www.randomofferings.com

  82. Yuval Ararat Says:

    Thank you!
    works like a charm.

  83. Duvy Says:

    this plug-in works great!

  84. Brigs Says:

    Nice work! Thanks for sharing the wealth.

  85. Tiverton Wanderer Says:

    All fixed now, google have updated the way in which ads are served to pages, so I can now display both horizontal and vertical ads with no conflicts whatsoever, thanks for a great plug-in!

  86. Neuromancer in Savannah » Blog Archive » Ad in line of the posts Says:

    […] mph movie trailer available Ad in line of the posts Just followed other’s idea trying to boost my Adsense income, which is still a sh […]

  87. Chris Knight Says:

    Greetings,

    I have been using Adsense on my blog and I think it is fantastic. Last night I updated WordPress to 1.5.3, and something broke. Where Adsense would only display one set of ads per page it now displays several. My first guess is that one of the security fixes in 1.5.3 broke the way you were setting the counter/flag that was used to control how many times Adsense displayed an ad. Have you seen this problem yet?

    -Chris

  88. jeffreybrady.com » Blog Archive » Well… Says:

    […] « Google Well… I added the adsense plugin from here and I hope it starts working. This entry w […]

  89. » Making Sense of Adsense Says:

    […] pposed to work on my WordPress software here at the www.acmetech.com/blog/ and here at the www.philhord.com/blog . Tomorrow, I’ll be trying out these Plug Ins […]

  90. Betamode Says:

    Plugin “WP-Amazon” blockiert(e) andere Plugins

    Das WP-Amazon-Plugin funktioniert zwar eigentlich ganz gut, blockierte bei mir jedoch einige andere Interface-Plugins. Eines der Opfer war das Adsense-Plugin, das wie das WP-Amazon einen Button zu der Quicktags-Leiste hinzufügt. Auch das superpra…

  91. Israel Says:

    I added the plugin to wp but adsense only shows on a few of my posts.
    Adsense won’t show on the main blog page (index.php), only if I go read more it will show ads for some posts.

    http://www.sherpatrek.com/weblog/

    Any suggestions?

    Thanks.

  92. fajarweb[dot]com Says:

    http://www.fajarweb has test it and work. klik http://www.fajarweb.com to review

  93. LuAnn Says:

    I have tried to follow this thread. I am very new at this. I do see the ad but I have errors on the dashboard
    Warning: Cannot modify header information - headers already sent by (output started at /home2/lelliott/public_html/blog/wp-content/plugins/adsense.php:111) in /home2/lelliott/public_html/blog/wp-admin/admin.php on line 10
    many other lines as well. Any help would be appreciated

  94. Jeff Says:

    awesome plugin

  95. khalid Says:

    working fine here thank alot :)

    http://www.petinsurancesupply.com

  96. U. Knightsbridge Says:

    Thanks! Worked fine here: http://www.medicineassociation.com/

    No problems at all! Very good info here.

  97. John Says:

    Thanks a ton, Phil! I tried Moosecandy, but it broke my RSS feed, so I had to dump it. In 10 seconds, your code was running flawlessly on my site. Drop by some time! http://blog.gadgetgurutech.com

  98. harris Says:

    Thanks, i was looking for this plugin to blend my google ads. and by the way, your blog footer looks kinda weird????fix it

  99. Kyle Says:

    Thanks for making this; been looking for something like it. :)

  100. Digital World Says:

    We customized your plugin to show adsense on single posts only between paragraphs and it works great. Good Job.

  101. Serge Says:

    Hi, many thanks for your plugin. It works fine!

  102. Adsense World Says:

    Very interesting (and useful tool) ! We have added it to our directory of Adsense tools.

    If only the Adsense integration at Blogger could be as elegant as this one…

  103. atba Says:

    We japanese like adsense,too.
    But not understading the word”adsense”.

    because Japanese speaks japanese english.

  104. Fanatyk Says:

    Nice.

    But I have only first ad. Adds in 2nd and further posts are invisible :(

  105. Online Web Resources » Blog Archive » Wordpress and Adsense inline Says:

    […] laquo; Adsense in Wordpress Wordpress and Adsense inline Author: PhilHord Download the plugin >> Download here How this plugin works ? Pu […]

  106. Devanshu Says:

    Thanks for the plugin- works perfectly and my websites are all the better for it. Good work :)

  107. Mad Says:

    Thanks for the plugin.

  108. Guile Says:

    Hi, many thanks for your plugin.

  109. Nützliche Wordpress Plugins » Webdesignblog Says:

    […] load) Werbung/Affiliate/Geld verdienen-Plugins Adsense Deluxe (Artikel) (Seite) Amazon Media Manager (Artikel) (Seite) Technorati […]

  110. John Says:

    Works perfectly! Thanks a ton!

  111. Anirudh Says:

    Thanks, it works on http://wwwblog.be

  112. jonathan Says:

    this plugin worked great in wordpress 1.5 but not in 2.0
    what should be done

  113. Cassie Says:

    I was using this plugin in 1.5 but upgraded to 2.0 and it no longer works. Any suggestions or chance of an update?

  114. Chung Says:

    Thanks for the plugin!

  115. Markku Says:

    Thanks for the plugin. It was very easy to install and works, absolutely great work.

  116. Christopher Says:

    Breaks in 2.0… any fix just yet?

  117. Christopher Richards Says:

    You are a god! Thanks from all of us at www.teamadness.com (just me really).

  118. Anirudh Says:

    It doesnt work on wordpress 2.0 on http://wwwblog.be

  119. yow chuan Says:

    Mine is working, but the post doesn’t seem to wrap alongside seamlessly like it does in your examples.

    Link: http://www.meshio.com/

    What could be the problem that might have cause this issue?

    Thanks!

  120. yow chuan Says:

    Problem solved, I edit the adsense.php and wrapped the AdSense code with the following:

    Not sure why it wasn’t there in the first place :-P

  121. Abhinav G Says:

    Buddy I hd the older version of WP 1.5 now got 2.0 please can u tell me what to do to add this new plugin in WP2 now.

    Really need it..

  122. johnny Says:

    I am search for adsense plugin for some finaly i got it .I am using this plugin for for my blog http://www.gadioc.com and http://laptops.gadioc.com

  123. randy Says:

    Thanks for the plugin! You have helped my Adsense earnings tremendously. Thanks!

  124. Guangming’s Blog » Blog Archive » Wordpress plugin Says:

    […] some useful plugins: Keyword plugin: this plugin inserts meta keyword tag for every post. Adsense plugin: this plugin helps do adsense easily. Originally I […]

  125. Adsense and Wordpress at R. Blake Ramick :: Journal Says:

    […] in journal

    This is a test of a plugin that I just found from: http://www.philhord.com/phord/adsense-inline-with-wordpress-blog-posts/ I’m testing it out right now.

    […]

  126. Ryan Lanane Says:

    Great Plugin, I am going to try to integrate it into http://www.hostingcommunity.com later tonight

  127. James Stephens Says:

    http://www.sns.ias.edu/~jns/wp/2006/01/25/fix-for-irrelevant-ads-in-wordpress-with-adsense/

  128. Ben Says:

    I’m using WP 2.0 and I can’t seem to find any quicktags let alone the Adsense quicktag. Looking in wp-admin I don’t seem to have a quicktags.js file either. Would installing quicktags.js solve the problem? Where can I it, if so?

  129. Little Po Says:

    Hi, Thank you for your plug-in,
    It worked for me, and my WP is version 2.0.

  130. rebecca Says:

    Im also have trouble using this in 2.0
    There is no quicktag at all and adding the code manually to posts doesnt bring up the adsense.

  131. rebecca Says:

    Ok I just found the solution for WP 2.0.
    You need to turn off that annoying visual editor when writing posts.

    Go to Users and down the bottom untick “Use the visual rich editor when writing”

    Now you can see the Adsense quicktag.

  132. mateen Says:

    Hi When applying adesnse code I am getting the following erroe.

    Parse error: parse error, unexpected T_STRING in /home/matynne5/public_html/medical-billing-resource/wp-content/plugins/adsense.php on line 47

    How do I resolve this error and activate my Plugins for adsense?

    Thank you.

  133. James Stephens Says:

    Adsense-Deluxe is the way to go:

    http://www.sns.ias.edu/~jns/wp/2006/02/04/try-the-adsense-deluxe-plugin-for-wordpress/

    It does the same thing and more ….

    James

  134. Lisa Says:

    hmmm, adsense-deluxe doesnt’ work for me. Not sure if its 2.0 related or what but this plug in works well. thanks.

  135. phord Says:

    “unexpected T_STRING” suggests that you added or left out a quote character somewhere. Look at your code closely for any typos.

  136. joan Says:

    I got AdSense working and all was well and now, for some reason it’s not inserting code any more. I’ve tried reinstalling, but still no go. Any ideas?

  137. shane Says:

    Thanks this plug in came in handy, for thouse interested this does work with the new 2.0 reliease of WP however i had to manualy type in the

  138. shane Says:

    do! what i meant was i had to type in the adsence (surounded by the angle brackets and such) tag.

  139. Jason’s Random Thoughts and Happenings » Blog Archive » � Adsense inline with WordPress blog posts — from the mind of Phord Says:

    […] � Adsense inline with WordPress blog posts — from the mind of Phord […]

  140. Down Among The Dead Beats » Blog Archive » Google Ads in Wordpress Posts Says:

    […] I got the plugin from here, on a single sheet which is always nice. […]

  141. OnlineCreditCardLand Says:

    Thank you very much for this cool plugin. It working perfectly for my WP 2.0 site.

  142. The Site Design Blog » Inserting AdSense Code Into Your Blog, Pt. I Says:

    […] Step 1) Go and download the AdSense plugin for Wordpress and install it. It takes a very small amount of tweaking - you just have to open up the file with a text editor and paste your AdSense code into it. Really quite easy. So go do that now. […]

  143. woofer Says:

    Thanx, man, i’m using this great plugin on my blog. Let God be wiyh You!!!

  144. Kickin’ It » Blog Archive » Adsense plugin Says:

    […] Check it out. […]

  145. Jason Says:

    Very nice plugin. I really appreciate your help. You can check out its implementation at http://www.kansascityseo.com/blog/

  146. Marketing Strategy Says:

    […] Adsense inline with WordPress blog posts — from the mind of Phord 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 […]

  147. Mauricio Says:

    Thanks for share this plugin!

  148. renee Says:

    this does not work for me…. i do not see any adsense button in my quicktags bar :(

  149. testing adsense plug-in - ClickNewz! An Internet Marketing Journal Says:

    […] For anyone that is interested in the Adsense Plugin for WordPress, here’s a link to more info: Adsense Within WordPress Posts. Enjoy! […]

  150. Tuncay Karaca Says:

    Adsense plugin did not work in my blog. There is no adsense button. WordPress version 2.0 I think it does not support version 2.0.

  151. Hans Says:

    I found the solution above. Just read this:

    Ok I just found the solution for WP 2.0.
    You need to turn off that annoying visual editor when writing posts.

    Go to Users and down the bottom untick “Use the visual rich editor when writing”

    Now you can see the Adsense quicktag.

    Thanks

  152. Tuncay Karaca Says:

    Hans,

    Thank you for advise. It worked.

    I started to use it.

  153. InsaneSkills Says:

    Great plugin. Thanks you so much for developing it. Installed easily. Php file is commented perfectly.

    WP 2.0 users make sure to check the visual editor button on the users menu.

    D

  154. It tastes like burning » links for 2006-03-18 Says:

    […] from the mind of Phord » Blog Archive » Adsense inline with WordPress blog posts (tags: adsense WordPress) […]

  155. BG Admin Says:

    Ah. I should try this too.

  156. BG Admin Says:

    I meant for my website www.bizgods.com :)

  157. Tech Blog » Blog Archive » Adsense inline with WordPress blog posts Says:

    […] From: http://www.philhord.com/phord/adsense-inline-with-wordpress-blog-posts-43.htm  […]

  158. PhiMix Says:

    Aloha,

    Isn’t it possible to have some PHP code around the adsense script?

    I have tried adding tags from PHP Exec to the script, but I can’t get my PHP code to execute :(

    For example I have tried the code below. It will then show CODE1, but not the random number and CODE2.

    $adsense_code = ‘

    CODE1


    ‘;

  159. PhiMix Says:

    oops, it didn’t like me adding PHP code to your comments.

    Inside the php and phpcode tags we have:

    srand(time());
    $random = (rand()%9);
    print(”Random is: $random”);
    CODE2

  160. khalid Says:

    Thank you

    It’s working fine in my website. added some amazon pic + asense hmmm great mod :)

    oh you can see my site and the plugin here Pets World

  161. DC Says:

    Thank you - installed and all working fine…

  162. Way To Freedom… » Blog Archive » Google AdSense Says:

    […] After read these two article this and this one , I try to follow it. I added Google Ads here.. But Wordpress is not for commercial purpose. So I decide to create a blog in blogspot, I have my dormant blog there, I activated and renamed become… […]

  163. Joe Says:

    GREAT PLUGIN! THANKS SO MUCH!

  164. exotic butterfly Says:

    Sounds good… I like to try this…

  165. My Google AdSense Experience » Webomatica Says:

    […] 2. This blog runs on WordPress so I added the Google ads by updating the footer and header files, therefore placing ads on every page with just a small amount of code. Google’s indexing does the ad selection. This WordPress plug-in places ads directly in the body of a post via a tag. […]

  166. Praveen Says:

    I uploaded the adsense.php in the plugins directory of my Word Press and also activated the plug. After that I am not sure what I must be doing. Can you please guide me through. i am not sure what this Quicktags tool bar is.

  167. Karthick Says:

    Rebecca! Thanks a lot for getting the adsense button to show up in quicktags. I am also using WP 2.0.

    Phil! It works like charm! :-)

  168. theGame Says:

    Thanks for your time and effort. Works great!

  169. Google Adsense Tips and Tools Collection « Quick Online Tips Says:

    […] Adsense Inline - insert adsense in blog posts […]

  170. Shiju Says:

    Excellent tips. I was able to increase my CTR by 50% using your advice. Thanks a lot. You might take a look at my site.

  171. NotInsured Says:

    Hi , thanks for your plugin, i have just downloaded it and currently messing around with my WP to integrate it.

  172. Jon Says:

    I’ve done everything you’ve said, and even have the ‘adsense’ button in my quicktags.

    However, the procedure I’m following is I click on the button and the ‘adsense tag’ shows up in the screen. Then I just click publish and the adds should show in the preview, but it doesn’t.

    Even after logging off and back in. I checked the source view and the code is definitely there.

    Any help you can give me would be appreciated. Anyone!

  173. Villarroel.info (beta) » Juguetes y herramientas para Adsense Says:

    […] Adsense Inline - inserta anuncios entre los posts […]

  174. Jon Says:

    Forget the above comment, I figured it out. However, when I go to the quicktags and click the adsense tag, this is what appears

    <!--adsense-->

    Then what? My code is in the plugin, do I add the code again in the pane or just click publish, because I still don’t get the ads.

    Thanks guys

  175. phord