I have about had it with WordPress AdSense plugins. There’s a ton of them out there (including themes with banner support) and none works properly. I don’t just want to inject a banner into a page, I want to inject it in the right place: where it gets noticed!
Ok, since no plugin gets it right, let’s start by listing the requirements and then build a plugin according to the specs:
Requirement 1: must be able to place AdSense in content. Nobody pays attention to the header or the side bar. This pretty much rules out any theme based solutions.
Requirement 2: Must be allow for flexible banner placement, in particular it must be possible to specify how the text is suppose to flow around the banner. There are a number of plugins that will automatically inject the code between paragraphs, but that usually turns out to be visually unappealing. Manual placement is a must!
Requirement 3: Must be safe to use. In particular I don’t want ads (from posts) to be included in summary pages or on the frontpage. I also want to be able to copy&paste the original code, not just the publisher ID and hope for the plugin developer to get it right. I also don’t want ads showing on every page, especially not by default. Less is sometimes more! Banners have no business showing on short posts or posts where I don’t want to send visitors to another site.
Requirement 4: Must not be over engineered! Bells and whistles are nice, but I have no use for a large list of features if it doesn’t get the actual job done. It’s pointless to be able to manage my account from the wordpress dashboard if I can’t (easily) place the banners where they are seen.
Requirement 5: Actually I don’t even want an AdSense injector at all (too special). Google will happily pay peanuts if a page doesn’t have high paying keywords on them. For those posts anything but AdSense is desirable. So what I really want is being able to say “banner here”, then load the banner code from a file.
Let’s be clear here: I am not looking for a “WordPress, please automatize this for me” solution. All I want is to be able to place a shortcode in my posts and have WordPress expand it to a banner there (and only there). Curiously, such a module is really easy to write (if you don’t need a fancy setup GUI). Click here to download the complete plugin. Using it is dead simple. Just put the following shortcode inside any post:
[sblock id="demo" style="adright"]
That will include a textblock stating “Hello world” (the contents of the blocks/demo file) into the post and flush it to the right.