Placing Adsense in WordPress Posts

Aug 26 2010 Published by admin under adsense, blogging, revenue, wordpress



Lots of people that use WordPress to blog or for websites monetize with Google Adsense. There are various themes and plugins available that make this relatively easy but they tend to have one big problem: all they do is place ads above posts or below posts, or in the sidebar area.

As all good bloggers know, if you want a decent click through rate (CTR) on your ads, the first port of call is the adsense heat map. As you can see, the best place to put ads is likely to be somewhere within the post.

Lots of people unnecessarily fear editing the WordPress code. In fact it is very easy.

All you need to do is go to Themes > Editor. In the right hand side bar you will see a list of files. The two you need are single.php and index.php.

Index.php controls the homepage of your blog, single.php controls individual posts.

In Index.php find the line of code that says

<div id=”container”>

Just slip your full adsense code directly underneath. That will give you an ad right above the title of the first post on your homepage, central to your readers viewpoint.

Now for the individual posts. How about having an ad indented next to the text, under the title (as in this blog)? Easy!

Open single.php and find the line of code

<div class=”entry-content”>

Underneath that, insert the following:

<div class=”alignright”> <script type=”text/javascript”><!–
google_ad_client = “pub-1234567890000″;
/* 336×280, created 00/00/0o */
google_ad_slot = “123456789″;
google_ad_width = 336;
google_ad_height = 280;
//–>
</script><br />
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>

Obviously, insert your own ad code above so you get paid! Also, change “alignright” to “alignleft” if you would prefer your ad to appear on the left. Click “update” and you will see a nice ad, and so will your readers.

If you would like to show ads in some posts but not others (or want different themes for different posts) see this excellent link.

No responses yet

Leave a Reply