After the number 1 question of what webhost do I use to host this blog, the number 2 most asked question is, “How do you set up the Google AdSense ads on your blog?” This question comes up a lot because the reader notices that my blog always limits the Google ads to three (Google’s limit). So, if you scroll pass the first two posts on the front page, you won’t see any more Google ads. However, if you click on any of those posts, the inline Google ad will appear inside the post.
This is a good time to remind readers that this blog has a search function and a Top Posts page. Before emailing me a question, you should try doing a search or check out the Top Posts page because there’s a chance I already written about it. In the case of the number 2 most asked question, I have written about it before. However, I’m going to use this post to explain it more.
AdSense Deluxe
The AdSense Deluxe WordPress Plugin is what I use to control the Google ads you see on this blog. The Plugin, which also works for Yahoo Publisher Network (YPN), is extremely easy to install and use. Just download, unzip and upload to your plugins folder. The plugin will place the above Adsense Deluxe screen to your WordPress options panel. From there you can create multiple AdSense ad units and decide what parts of the site should have or not have ads, and what ad sizes to run.
In the above screen shot, you can see I have three AdSense ad units listed; 468, bottom and default (which is a 300×250). The easiest way to integrate AdSense Deluxe into WordPress is by editing the index.php file of the theme template. To make the Google 468 show up at the top of every page on the blog, I just add <!–adsense#468–> to the part of the template where I want the Google ad to appear. The same goes for the bottom Google ad, which I currently do no run.
To get a Google ad to show up inside a blog post I just insert <!–adsense–> at the spot where I want the ad to show up. To align the ad to the right and make the text wrap around the Google ad, I use this table command: <table align="right"><tr><td><!–adsense–></td></tr></table>. Just change it to align=”left” if you wish place the ad on the left side.
*Update – Thanks to Tam Denholm for this. For cleaner HTML, use a div command: <div style="float: right; margin: 5px;"><!–adsense–></div>. The margin adds a bit space around the AdSense unit.
The Plugin will keep track on the number of AdSense ads running on the page and limit that number to three. This is why you will not see a 300×250 inline Google ad on all the front page blog posts, but the ad will show up when you click to read the post. Another nice feature of AdSense Deluxe is the ability to globally enable and disable ads. I can turn on or off all the Google ads on this blog with just a click on the mouse. Alternatively, I can just turn off the ads in the home page or individual posts only. The plugin has tons of options.
If you’re going to run Google AdSense on a WordPress blog, then AdSense Deluxe is a must have plugin. The next time someone sends me an email about how I do my Google ads, I’ll just send him or her the link to this post. 🙂