How to set up adsense ads on your blogger blog

One of my visitors asked me about how can I show adsense below the title of the post but not on main page or index page on my blogger blog. That’s why I have come with a post to tell you how to set up adsense ads on your blogger blog.

How to set up adsense ads on your blogger blog

First let me tell you about how can you show ads below every post title but not on home page. You just need to place your add b/w a small code. First get your adsense ad code from your Google adsense account, open a text editor(like Notepad) and paste your adsense ad code. Then press CTRL + H on your keyboard and do the following
Replace all ‘<‘ with ‘&lt;‘ and all ‘>‘ with ‘&gt;‘.

For more help look at this image below:-

How to set up adsense ads on your blogger blog

Now Go to your Blogger Template Editor and check ‘Expand Widget Templates‘ and press ‘CTRL + F‘ and find this code <data:post.body/> and paste the following code just above <data:post.body/>.
<b:if cond=’data:blog.pageType == "item"’>

<--Your Adsense ad Code that you have edited in Text Editor-->


Make sure that you have put your adsense ad code in correct place. If you have done with all above things the final code will look like

<b:if cond=’data:blog.pageType == "item"’>
&lt;script type="text/javascript"&gt;&lt;!–
google_ad_client = "pub-****************";
google_ad_host = "pub-****************";
/* 336×280, */
google_ad_slot = "**********";
google_ad_width = 336;
google_ad_height = 280;
&lt;script type="text/javascript"

And now save your template. This way your adsense ad below the post title will do not appear on your homepage. It will appear only on post pages.

You might like to know How to show adsense only to organic visitors on blogger platform

But in case if you want your Google adsense ads appear only on homepage like some where below the header or sidebar then you need to use the below code

<b:if cond=’data:blog.pageType == “index”‘>

<--Your Adsense ad Code that you have edited in Text Editor-->


You may also like How to earn 500$ in a day from Google Adsense

And if you want to show Google adsense ads on a particular page then use the following code

<b:if cond=’data:blog.url ==Write URL here‘>

<--Your Adsense ad Code that you have edited in Text Editor-->


I hope you will find this post useful if you are using adsense on your Blogger blog.

Enjoy your Day!!!
Comments are always Welcome!!!

Related Posts:

7 Comments Post a Comment
  1. Anshul Dixit says:

    Thanks a lot. This helped :). But there is a small mistake in the code that you have mentioned. Instead of replacing all occurrence of '<' and '>' you only need to change '' to '–>'

  2. Avi Singh says:

    '' to '–>'
    same things 🙂
    What are you talking about?

  3. Anshul Dixit says:

    Well you told to replace < with & lt . Instead of replacing all occurrence of < and > you just need to replace with & gt.

    I wrote the same thing in first comment, but Disqus interpreted it as html and changes it to its corresponding character.

  4. Avi Singh says:

    Ok….. Thanks for sharing 🙂

  5. Janine says:

    Hello, and thank you !!
    The html editor doesn’t allow me to put the code for avoiding the ads to appear in the home pase, as I would like.
    This is the message that I get :
    Your template could not be parsed as it is not well-formed. Please make sure that all XML elements are closed properly.
    XML error message: Open quote is expected for attribute “{1}” associated with an element type “cond”.
    Is there any way that you canhelp me with this ?
    Best regards.


    • avitricks says:

      Hello Janine,

      You should first take back up of your blogger theme then do these experiments.. 🙂
      And I think all the above codes are working fine here for my blogger blog… You should check whether you are putting above codes at the right place…. Re-read this post and meanwhile check your blogger template clearly and place the code in the right place…. And if again you are facing this problem, you can contact me personally…. I would love to help others…. 🙂

  6. thanks for this, i will try on my blog

Leave a Comment

Stay Connected

This service is free. Get up-to-date information directly to your email. Your email address is safe with us.

social RSS Feed Twitter Facebook Google


Avi Singh, the editor-in-chief of Avitricks Group, persuing B.Tech in Information Technology from India. He has been on Internet for many years now....