Show Adsense Ads Only on Homepage or Post pages on Blogger and WordPress

Having same ad format all over your blogs might lead to a lower CTR since your visitors will get familiar with your regular ad formats and locations. It’s a wise idea to show different ad formats on different pages. Yes, you can show different ads on homepage and post pages on your Blogger or self hosted WordPress blogs. All you have to do is use the conditional tags with the ad code. You may use a conditional tag to show ads only on homepage and another conditional tag to show ads only on post pages. In this way, you can show different ads on homepage and blog post pages.

On Solidblogger, you can see banner sized ads (468*60) on the homepage while individual post pages will show square size ads (336*280 and 300*250). If you want to show different ads on your blog also, you can do this easily by adding a conditional tag.

show different ads on blogger or wordpress

Show Adsense ads on homepage or individual blog posts on Blogger

To show ads on homepage only, modify your code like this :


<b:if cond='data:blog.pageType != &quot;item&quot;'> YOUR ADVERTISEMENT CODE </b:if>

To show ads on individual blog posts only, modify your code like this :

<b:if cond='data:blog.pageType == &quot;item&quot;'> YOUR ADVERTISEMENT CODE </b:if>

Show Adssense Ads on Homepage or individual posts only on WordPress blogs

To show ads only on WordPress homepage, modify your code like the following example :

<?php if (is_home()) { ?>
YOUR ADVERTISEMENT CODE
<?php } ?>

To show ads only on individual blog posts only, modify code like this :

<?php if (is_single()) { ?>
YOUR ADVERTISEMENT CODE
<?php } ?>

Replace YOUR ADVERTISEMENT CODE with your actual Google Adsense ad code. If you want to show the same ads everywhere, simply remove the above conditional tags and keep the advertisement code only.

We will send you some more information related to Show Adsense Ads Only on Homepage or Post pages on Blogger and WordPress

Below are some more related articles to the topic:

How to Show Ads on WordPress Homepage Only
Read More Plugin to show Post Summary with Thumbnails Automatically on Blogger Homepage
Show Adsense Ads inside Blogger Posts, Wrapped with Post Text
Show Animated Image Icon Before Post Titles in Blogger / Blogspot
Show Post & Comments Count in Blogger / Blogspot Blogs

Tags: , , , , ,

5 Responses to “Show Adsense Ads Only on Homepage or Post pages on Blogger and WordPress”

  1. Rohit 21. Jun, 2009 at 9:59 pm #

    They are useful for blogger newbies indeed because in WordPress, task can accomplished using various Plugins.

  2. retnet 29. Jul, 2009 at 10:09 pm #

    this tutorial is very useful for me, thanks…

  3. Rajj 11. Aug, 2009 at 9:47 am #

    this is a gr8 tip, took long time to find this here. Thx for sharing..

  4. sultan . mehmood 01. Sep, 2009 at 6:35 pm #

    thanks but i want to apply it blogger it is not working for me any way thanks

  5. dudemjk 30. Nov, 2009 at 7:13 am #

    not working for blogger, it say Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
    XML error message: The element type “head” must be terminated by the matching end-tag “”.

Leave a Reply