How To Add AdSense Ads To A WordPress Blog

Placing Google AdSense on your WordPress can be accomplished in a variety of ways. Because of the big blogging rush happening right now many people are building blogs to make money blogging. And the first thing they want to do is to put Google AdSense on their blog. Here is a that gives you different options for integrating Ads into your .

The first and obvious area to place your ads is on the sidebar. This has never been easier with the use of text widgets. To place AdSense on your sidebar read this: Working With WordPress Text Widgets

Then there are plugins to place AdSense within your blog posts. The most popular one, and the one I include when I install WordPress is AdSense Deluxe. Read how to Install And Configure AdSense Deluxe WordPress Plugin.

To add AdSense or other ads directly into your you must place the ad code directly into a few of the themes files depending on where you want the ads to show.

To edit your themes files from within the the file permissions must be set to writable on your hosting account, CHMOD them to 666 or 777. Then from the dashboard go to Presentation, Theme Editor. Make sure you have a backup of the file you are editing if you are not comfortable messing around with the code in there.

If you want the ads to show on the top of the main page above the title of the first post you need to place them in the Main Index or index.php file. Look for and open index.php on the right side of the theme editor. Look for this code near the top and place your ads like shown below:

Put Your Ad Code Here

<?php if (have_posts()) : //Are there any posts? ?>

You can do the same steps above on the Single Post (single.php), Archives (archive.php) and the Page Template (page.php).

As you start looking at the different files, you can start to see different places to place your ads, or anything for that matter within your blogs theme. For example to place the ad code on the bottom of each post Open the Single Post template (single.php). Place the ad code in the area show just below the post:

<?php if(have_posts()): ?><?php while(have_posts()):the_post(); ?>

<div class=”post”>
Place Ad Code Here

One note of caution! Please copy, paste and save into a text file on your computer all the text in any file you are attempting to edit before you make any changes!



Share This AddThis Social Bookmark Button Sphinn Gregarious FeedFlare

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!


Tagged with , ,


Related Posts





15 Responses to “How To Add AdSense Ads To A WordPress Blog”

  1. If you want the ads to show on the top of the main page above the title of the first post you need to place them in the Main Index or index.php file. Look for and open index.php on the right side of the theme editor. Look for this code near the top and place your ads like shown below:

    Title Of Site

  2. “To edit your themes files from within the WordPress dashboard the file permissions must be set to writable on your hosting account, CHMOD them to 666 or 777.”

    For security sake, I would suggest everyone that does it this way to change back the permissions to 666 once you’re done with editing.

  3. is there a way of adding the adsense block just below the first post only, instead of below every post?

  4. Yes you can place an AdSense block just about anywhere. To add it to the bottom of the first post on the main blog page:

    Open the Main Index Template (index.php) and place the AdSense code under the block of code that starts like this:

    <?php the_content

    That will put it under the post before the comment area, if it is showing. You can experiment with different places in the index.php file

  5. Adding the adsense codes is easy, but optimizing the layout is another story. :)

  6. Hi information you provided are quite helpful ….but i want to know how to add adsense code in the sidebar??

    please help

  7. debashish, you just need to place the AdSense code into a text widget if your theme is setup for them.

    See this post:
    Working With WordPress Text Widgets

  8. Aww, I’ve been searching through so many tutorials but I don’t actually have a single.php file in my theme folder! How is that possible!? I’d really like to put ads below every post, and have those ads viewable only when the reader clicks on that post.. Help! o.O

  9. I V Y O L O G Y , I can’t answer your question without seeing your theme’s files.

  10. Wow, super fast response Jeff! But it’s ok, I worked out how to do it the easy way - download a plugin :P Thanks for your help!

  11. Jeff, by your experience, where’s the best spot to place adsense ads?

  12. I don’t actually track AdSense placement, and admit I am not an AdSense placement expert, but my first choice would be at the bottom of the post for a well written blog. So the reader has somewhere to click to after they are done reading.

  13. The information you provided are quite helpful.Thanks

    Windows Vista Help and Support

  14. What does everyone think about “adsense blindness”? Where browsers ignore what looks like an adsense ad because they are too familiar with the format?
    I believe Yahoo will make big leaps forward with paid ads soon. They are a lot easier to slip in discretely!!

  15. I agree, Yahoo ads are a lot easier to individually style

Discussion Area - Leave a Comment

If you have a question about your blog please leave a link to it. Please don't ask questions like "Why don't my blog work right?" and expect an answer.

Two links or less are welcome, any more and your comment will be spammed! Nofollow has been disabled, all comments are moderated and will not appear until approved. Please submit only once.



XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Or just copy the example below and change your details.
Example - <a href="http://www.YourSite.com">Title Of Site</a>







Close
E-mail It