To hide (or show) widgets in particular posts, static pages, homepage or archive pages, you can use conditional tags.
Step 1. Go to Blogger's Dashboard > Layout and name the HTML/Javascript gadgets that you have already added. Doing this, it will be easier for you to identify the widgets that you have in your Blogger's template. Give it a unique title so that it does not match with any of the titles of any other widgets already added.
Step 2. Next thing to do is to go to Template and click on Edit HTML
Step 3. Select the "Expand Widget Templates" checkbox.
Step 4. Find the widget's title in the HTML by using Ctrl+F and entering the widget's name in the search box.
Let's say that the title for one of my widgets is "Recent Posts". After searching for the widget's name, I will find a similar code in my template:
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:includable>
</b:widget>
This code represents the widget/gadget that I have added in the Page Elements location (Layout).
Step 5. After you've found your widget's code, add the following conditional tags marked with red just below and above to hide the widget from specific pages or posts in Blogger. For instance, in case you want:
To show the widget only in Homepage:
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>
To show Blogger widget only in post pages
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "item"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>
To show the widget in a specific page
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == "URL of the page"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>
Note: Replace URL of the page with the address of the page in which you want the widget to appear
To hide a widget only in a particular page
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url != "URL of the page"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>
To show widgets only in static pages
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "static_page"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>
To hide widgets in Static Pages
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType != "static_page"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>
To show widgets only in Archive Pages
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "archive"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>
Step 6. After you have added the conditional tags, Save Template and view your blog.
That's it!





Thanks Dear, Nice Post
ReplyDeleteBut I have applied a new trick that hides adsense from post pages and displays in home pages, index pages and static pages in my blog www.odishajobs.in
thanks a lot
ReplyDeletevery helpful post..I already apply this trick.
http://einews.blogspot.com
Hi, Can i check, I've tried this method for the "To show widget in a specific page" but it ends up hiding the widget in all my pages. Am i doing something wrong such as pasting the wrong URL?
ReplyDeleteIt depends on what you want to do. The method you have chosen will hide the widget in any other pages but not from the specific page you've typed between the quotation marks..
DeleteI have tired it very much but failed to me . Please you must do it for me (Admin)as you know all blogger . I have idea ! download teamviewer and you do it for me . My skype id is ali1881992 . Add me contact then i will accept you . Please help me for little work .
Delete"To show widget in a specific page" not working for me also..
Deletethe same problem
DeleteDear Brother I Have One Question How To Hide All Widgets In Perticular Page Like HTML Editor, COntant Page ETC.
ReplyDeleteSo Please Give Me help Full Answer...Thanks
As an admin I want to name my( by adding Title Name in blogger) widgets in blogger but these Title Names get published . I want these title names to RECOGNIZE my widgets but I want 'Title Names' not to be published and keep it hidden from viewers and readers.
ReplyDeleteIt works great ! Thank you.
ReplyDeleteYou're welcome. Thanks for visiting!
DeleteThank u so much for great post.... but I think this post needs little update. This basic code don't match new basic code...
ReplyDeleteSo, what can I do now?
Hi,
ReplyDeleteAs "Paper Crane", I have tried to display a widget on a specific page but it ends up hiding the widget in all my pages.
Have you try it personally?
Thks
Do you have a region specific blog?
DeleteExample: blogger.com.au
If yes, try removing the last extension ".au" in the urls.
SO, if you are using:
use the url like this:
http://helplogger.blogspot.com/2012/03/hideshow-widgetsgadgets-in.html
and NOT
http://helplogger.blogspot.com.au/2012/03/hideshow-widgetsgadgets-in.html
hope it makes sense...
This works well. In my blog, I present widgets on both sides of the page on the homepage, while the widgets on the right sidebar disappear in the rest of the pages (they are not needed in further pages). I'm wondering if there is a way in those pages for the blog posts to expand into the right sidebar area. (Right now, the blog posts in those pages just occupy the center of the page, and the right sidebar is empty.)
ReplyDeleteThis sounds super helpful! i am definitely going to try this. Thanks so much for sharing :) and keep up the good work.
ReplyDeleteIf the widget doesn't show up, make sure your URL does not end country specific. blogspot.com.br for example... remove the br.
ReplyDeleteWhat if I want a widget to appear in two specific pages?
This is great! I've searched high and low for a way to hide blog posts from the homepage but not any other page and this is the only one that worked. THANK YOU!
ReplyDeleteThanks for this information. I was able to have my "sharethis" buttons to only show on post pages. I find it annoying when people share a page from a homepageurl or other non-post page, and then I can't find the page. That's why I wanted these button to only show on my post (item) pages...and you showed me how! :)
ReplyDeleteHi, This is Neel. I saw your blog looks intresting. I want to create similar setup for my blog. I want to have a blog with posts. My basic needs are below
ReplyDelete1. Image, video post
2. Post with author information displaying
3. SEO ready
4. A contact page
5. Social integration
6. From one post link to similar posts
7. Home screen displaying About and link to all tags/labels
Also, I want to have it with low cost, as it is just a personal blog. Can you please help me understand how to go with this ? you can reach me at nilanchala@outlook.com
Very informative for me. I've already applied it. Thanks for provided source code!
ReplyDeleteHow do I keep a widget from showing in a particular label (tag)?
ReplyDeleteHi I did the "To hide widgets in Static Pages" and it works. Thank you. But it hides my header on all of the static pages aswell which I didn't want. Could you help me figure it out? Thank you.
ReplyDeleteIs there any way to put a code like this in the HTML for the page itself? I have a fairly long list of URLs that I don't want adsense on, but I don't want to have to add all of them to my template page.
ReplyDeleteDear sir, Actually problem is that when I try to add any widget below the post like related posts, subscription box, social sharing widget..
ReplyDeleteThe codes of that widget add successfully but no showing...
whats the matter? Is there something missing in my blogger template.....
my blog is www.studentvoice.in
very nice widget and trick, thanks alot
ReplyDeleteHi Admin,
ReplyDeleteI wondering which code is to show the widget in all pages.
Please help me.
Thanks a lot.
Great job, Very nice post-I'm looking for.
ReplyDeletehelp it not work with me....
ReplyDeleteeverytime i put the code
when i save it changed to
and the widget still appear
Works great. Thank you very much! :)
ReplyDeleteMy blog = http://flutelyrics.blogspot.com/
If adsense is in the post body (not widget), how can I hide adsense in my policy post.
ReplyDeletethank very usefull information
ReplyDeletein this code? how to declare different urls?
ReplyDeleteexample link1 link2 ?
I have been looking for this tweak for quite a long time and you gave me an answer to my questions. Thanks for the tutorial. :)
ReplyDeleteAs Paper Crane and FLO, my widget ends up being hided on all pages! And it doesn't work by removing the country specific ending in the URL, like Stevendale says.
ReplyDeleteWhat is wrong? Please help.
And when that problem is solved, I would very much like to know "what if I want a widget to appear in two specific pages?", like Stevendale askes.
Thanx for all the other good tips :)
Hey! I solved it! It's like Stevendale says: Remove the country specific endning, but replace it with ".com" - then it show on the specific page.
ReplyDeleteI'd still like to know how to hide/show gadgets on two or more specific pages, though...
Can anyone help?
I redirected my hone to a new static page how to show it on a specific static page
ReplyDeleteI have some gadgets that I want to appear only in Certain posts (more than one) that fall under a single Label. To be more specific I have gadgets that I only want to appear when a visitors is looking posts under the label betting. But not appear when a visitor is looking on other posts. Can that be done??? (not just when visiting the whole Betting label but any post from that label, but in none of the other posts). Hope you can help me
ReplyDeleteI'm trying to hide the Archives and Lables gadgets from my other pages. I just want them visible on my homepage. When I used the snippets used in your "Recent Post" example I got errors. Please, help!?!
ReplyDeleteCan you tell me how to show the widget only on a specific static page
ReplyDeleteCan you please give me the code to display a widget only in homepge and label pages
ReplyDeletehey it worked well. Well could you tell me how to show a widget on a specific static page. Eg only on about us static page.
ReplyDeleteThanks..You solve my another problem...
ReplyDeleteI have been looking for this
ReplyDeletehttp://www.tech-fans.com/
Thanks so much for this post! You saved me a huge headache! LOL :)
ReplyDeleteYou're welcome :)
DeleteSo I had to change my template back to the default blogger templates because the one I had was giving me grief! Now I am having a problem doing what worked for me before:( I want to hide my sharethis widget on my blog from the static front page and display them on "posts only". I put the code you gave here: To hide widgets in Static Pages
DeleteIf you look in my template the code in red you said to put is there and is implemented properly but it's not working:( Please help!
Hi Tasha,
DeleteCould you please send me a copy of your template to helplogger76@gmail.com ? Thanks.
sent;)
DeleteHow do I use these codes in xhtml? I am getting an error message, Error parsing XML, line 2139, column 3: The element type "b:if" must be terminated by the matching end-tag "". Help please?
ReplyDeleteMost likely, you didn't add the closing tag in the right place. Make sure that you add the </b:if> closing tag right after <b:include name='quickedit'/> and the conditional tag after <b:includable id='main'>.
DeleteI have the same issue. I have double checked this to make sure I'm inserting in the correct place.. Still get the above error.
DeleteHeya! My name is Aisha
ReplyDeleteand I really just wanted to say your blog rocks!
It's funny simply because I use to have a blog that nearly had an identical web address: http://www.blogger.com/comment.g?blogID=3126197138969349243&postID=1271181592539982835 mine was only a few characters different.
Anyways, I'm a big fan of
your blog and if you
ever want a guest post please email me personally at: augustuscambell@gmx.
net. I absolutely love writing!
Also visit my webpage ... Click here
Hello I've tried the "hide in a specific page" method but it hides in all pages, and I did exactly how the example shows. Can someone in lighten me how to solve the problem? Ty.
ReplyDeletePlease check your URL, it should end up with .com
DeleteSee the bolded part in my address:
http://helplogger.blogspot.com/2012/03/hideshow-widgetsgadgets-in.html
Sorry for the late reply.
I tried this for the sharethis widget to appear only on posts and not on static pages and it worked! Thanks! However I tried to hide my Adsense widgets from my contact and privacy pages using your code To hide a widget only in a particular page and it didn't work. Please help!
ReplyDeleteYou should hide the entire sidebar in those pages. Please check this tutorial: How to Hide Blogger Sidebar to Display AdSense For Search Results
DeleteIt was initially written for the search results page but it works on other pages, as well.
yeah, works great, the problem was with the new domains from blogger, was easier when it just ended in .com ! ty
DeleteFriend, I wanted to show the gadget only on one specific page, I tried your code, everything worked perfectly(code), but the gadget doesn't appear on any page. What's the problem!
ReplyDeleteHello admin....how to hide sidebar likes your static pages?....such as http://helplogger.blogspot.com/p/acceptance-of-terms-by-accessing.html.
ReplyDeletehey hi admin can you tell me where is the feed url of blog?
ReplyDeleteand how to keep privacy policy,disclaimer and terms of service?
Thank you so much for this trick! I used to to add a widget on my homepage only, right above the posts and it worked. I have one problem: on the other pages of my blog there is now a gap above the title of the page where the widget goes on the home page. Is there any way to get rid of this gap?
ReplyDeleteThank you so much for this information. I've been looking for something like this for a while now just to help my site look a bit cleaner, clearer and professional. This is a big help!! Thanks :D
ReplyDeleteShooting My Journey x
mine does not display the widget on any page.
ReplyDeleteI have a very long list of labels that I would like to either be hidden from the homepage OR display only on a static page I've made just for this purpose. As I cannot place the widget directly onto the body of the page (right?) I've settled for having the list display only where needed.
My trouble is, with this code, no matter what I try, exclude from specific page (the home page)) or show only on a specific page (the story page), it disapears from all pages.
The code i've used for the hide only from home is(sniped of course)
blah blah rest of code
My website is a .ca one.. so I've changed from blogspot.ca to .com as suggested above, but that did not help either.
Any assistance would be helpful. Thanks.
This is brilliant. Thanks for so clearly illustrating what to do for different pages, such as hiding on static pages versus displaying for only one particular page.
ReplyDeleteHi how do you do this on the new html blogger format? I noticed "-- only display title if it's non-empty -->" in my sidebar before 'grab my button' I looked in layout none of my widgets have this and both widget above and below has a title. Any further tips?
ReplyDeleteWould you mind taking a look? I am sure its newly appeared.
http://www.kellymartinspeaks.co.uk
it was so good it worked and I've been using it..
ReplyDeleteoyun oyna
thank you, i have been looking for this for ages
ReplyDeleteThank You , its Working
ReplyDeleteVery helpful article! Thanks!! :)
ReplyDeletecrap my code on my blogger looks nothing like this at all so i have no clue where to place the code. tried a few times but not working
ReplyDeletedoesnt work at allllllllllllllllllll
ReplyDeleteNice share! Very informative, will try it on my blog.
ReplyDeleteNice ! It works :) I've used it on my site
ReplyDeletehttp://collegemarketing101.blogspot.com/
Thank you!
I must say, you are superb
ReplyDeleteThanks a lot. That was really helpful for hiding my author info box on a guest post!
ReplyDelete