AskCarl: How to Add AdSense to a WordPress blog? In Various Situations
John e-mailed me a while ago asking me on how did I place AdSense to my WordPress blog. Too bad John didn’t have a site to show me. Anyway I’ll post here my tutorial on how to add Adsense into a WP blog.
Adding AdSense After Post Titles
Let’s go on the basics first. For example: You want to add a 336 x 280 AdSense block below you post title. Open your index.php then look for the part that looks like this:

And if you want to wrap that block, like most blogs do. Add a div into the Adsense code that may look like the one below:

Just adjust the margin that suits your blog design best and of course you could also change the float to “left” or “right”.
Some have situations adding an AdSense unit on their first post but not on the second (I used to do this before ) to do that, open your index.php then look for something like this:

We’re not done yet! Look for this on your index.php:

Then place this on the part that says “****Your Adsense Code goes here****“

See, piece of cake
Special thanks to tamba2 for the code.
Adding AdSense After Every Entry
If you want to place an Adsense block every after your entry ( Like what I have — for now
) You will need to open your index.php then look for this part:

And if you want, you can also add a center tag to make it look more decent.
Adding AdSense to Single Posts
If you want AdSense only in your single posts. Open your single.php then look for something like this:

Actually it’s the same as Adding AdSense After Post Titles (Above)
Adding AdSense Before your Header
Lastly, if you want to add an AdSense unit before your header (Like b5media blogs, etc.)
Open your header.php and look for a code like the one below:

Easy!
But still if it’s that hard for you to integrate AdSense units to your WordPress blog, there’s always a plugins to the help.
If you have any comments or want to add or suggest something. Don’t be shy to leave me a comment
Have any questions? Don’t want to waste time searching Google? just drop me a mail and I’ll try my best to answer your question!



Enter your name and email below, then click the "Free Instant Access!" button to get the free report.













October 12, 2007
2:12 pm #comment-1
Hi Carl.
I am just set up one wordpress at my host. I open index.php it ‘s empty inside…Where I can looking for index.php…I am newbie..Thank
Peter
November 7, 2007
3:40 pm #comment-2
Carl, you are cool.. lol. I use blogger.
December 4, 2007
12:20 am #comment-3
Thanks Carl….just what I was searching for! I couldn’t believe when I scrolled down and found out you are 13 or 14…God Bless You! You will surely succeed in life! Thanks again!
April 19, 2008
8:20 am #comment-4
I have created a google blogger but when I try to add the adsense code into my blogger, it gave me an error message. I try it many time but I just get the same error message. HELP! I’m new with this internet thing and am in need of someone who know what they’re doing. It would be nice to have my blogger up and running. Can you help me? Thanks
August 6, 2008
7:14 am #comment-5
Hi Carl,
I’m trying to put an adsense vertical widget in my sidebar. I’ve copied the code into a ‘text’ unit in my sidebar but it’s not showing….sob.
What should I do?
August 27, 2008
9:08 pm #comment-6
Thanks Carl. Don’t forget adding the code is the first step, to get the most out of monetizing a blog you need to think about other factors – blending in the colours to match you own colour scheme – the site of the ads – using link units etc. There is a whole world to this area but adding the code is a great start!
September 24, 2008
8:25 am #comment-7
we are super proud of you carl niels ocab.com! kidblogger. KEEP BLOGGING :D
April 3, 2009
9:35 am #comment-8
wow you made it so simple.
but im still finding it hard, maybe i have different version of wordpress. >.<
April 21, 2009
6:47 am #comment-9
How I can add adsense advertisements after the header?!
Thank you.
May 28, 2009
8:49 am #comment-10
I watch this guy for year, yea he do a lot of crazy stuff, but I know he is a really good and nice person. My boyfriend got his all best fights and we probably going to pray today and watch his in ring – so sad love you Mike.
July 7, 2009
2:19 am #comment-11
It is a lot of talking about M. Jacksondead, it’s a very sasd for me because I love his music, I still didn’t believe in his dead. Hi was a definitely King of music
November 26, 2009
11:21 pm #comment-12
This is just what I have been looking for – to add 336 x 280 AdSense block below my blog post title/s.
I will try it. I just hope it works.
Much thanks for this tip.
Faith @Bloggersum
April 18, 2010
10:11 pm #comment-13
do you think inove theme is adsense optimized?
July 5, 2010
3:27 pm #comment-14
Thanks very much for another marvellous post. I am always looking for good WordPress tips to recommend to my readers. Thank you for writing this post. It’s exactly what I was looking for. Truly first-class post.
July 25, 2010
10:08 am #comment-15
Hello admine
great post. i have read and learn from your site…but you can still find morn info on my site too….http://onlineuniqueclicks.com/