How to enable Adsense on your WordPress single posts only

March 5, 2006 by  

This simple tip lets you enable Adsense on your single posts if you do not have the single.php file in your theme.

To do this, perform the following steps.

  1. Login to you WordPress administration panel, then go to Presentation > Theme Editor.
  2. Open index.php and add the following code where you want your Adsense to appear

    <?php if (is_single()) {
    Put your Adsense code here
    } ?>

  3. Press ‘Update File’ to finalize the changes.
Did you enjoy this post? Please subscribe via RSS or email.

Related posts


RSS feed | Trackback URI


Comment by Stu
2006-03-31 10:10:20

You could also use the excellent Adsense Deluxe plugin at

Comment by Gaman
2006-03-31 10:23:23

Yea, I’ve been using Adsense Deluxe and infact it’s listed in my top 10.

But if you want to enable Adsense on a single post only, you’ll have to tweak and add the code. Otherwise, your ads will be shown on your homepage too.

Comment by korokmu
2006-04-15 15:17:01

no you don’t need the code. on the adsense deluxe admin panel, there are options,where to put the ads

Comment by Gaman
2006-04-15 15:23:23

In a way, you can do that but showing Adsense code anywhere in your post is one thing, but showing only a few of the Adsense blocks on certain posts/page, while disabling the other and vice versa is another thing

The option will enable all the Adsense blocks instead of one or two so you have lesser control. The option alone does not do what I wanted.

But for most people, the option alone is good enough for their needs. 🙂

Comment by korokmu
2006-04-16 10:37:01

ok, i got your point. thanks

Comment by hamdyy
2008-02-03 22:54:13

please help me how to put adsense ads between posts
Many thanks for helping

Comment by Singles Holidays
2011-10-13 18:05:19

If we owned a WordPress blog, how many comments we approved on a single post?
Is there any limitations for comments on blog posts, how many comments we approve on a single blog post??

Name (required)
E-mail (required - never shown publicly)
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> in your comment.

Trackback responses to this post