Blogger normally displays a widget wherever its Layout section allows it, but sometimes you may want a gadget to appear only on the homepage, individual posts, static pages or one specific URL.
Blogger template conditional tags make this possible without using JavaScript or hiding the widget with unnecessary CSS.
This guide explains how to show or hide Blogger widgets on specific pages using modern Blogger conditions such as data:view.isHomepage, data:view.isPost and data:view.isPage.

Why Control Blogger Widget Visibility?
You may not want every gadget displayed everywhere.
For example:
- A Featured Post may only be needed on the homepage.
- Related Posts should normally appear only on individual posts.
- A Contact Form may only be needed on the Contact page.
- A large promotional banner may be unnecessary on static pages.
- A sidebar widget may need to be hidden from search results.
Blogger conditional tags let the template decide whether the widget should be rendered on the current page.
Back Up Your Blogger Theme First
Widget visibility conditions are added through the Blogger template editor.
Before changing the code, go to:
Blogger → Theme → Backup
Download a copy of your current XML template.
If something goes wrong, you can restore the previous version. See our Blogger theme backup guide.
How Blogger Widget Conditions Work
A normal Blogger widget may begin like this:
<b:widget id='HTML1'
locked='false'
title='Custom Widget'
type='HTML'
visible='true'>
You can add a cond attribute directly to the opening <b:widget> tag.
For example:
<b:widget cond='data:view.isHomepage'
id='HTML1'
locked='false'
title='Custom Widget'
type='HTML'
visible='true'>
This tells Blogger to render that widget only when the visitor is viewing the homepage.
How to Find a Widget in Blogger HTML
Go to:
Blogger → Theme → Edit HTML
Use the Jump to Widget option and select the gadget you want to modify.
Widget IDs may look like:
HTML1
PopularPosts1
FeaturedPost1
Label1
PageList1
Find its opening:
<b:widget ...>
and add the appropriate condition there.
Show a Blogger Widget Only on the Homepage
Use:
cond='data:view.isHomepage'
Example:
<b:widget cond='data:view.isHomepage'
id='FeaturedPost1'
locked='false'
title='Featured Post'
type='FeaturedPost'
visible='true'>
The widget will appear on the homepage but not on posts, static pages or other views.
Hide a Widget Only From the Homepage
Add an exclamation mark before the condition:
cond='!data:view.isHomepage'
For example:
<b:widget cond='!data:view.isHomepage'
id='HTML1'
locked='false'
title='Sidebar Widget'
type='HTML'
visible='true'>
This means:
Show everywhere except the homepage.
Show a Widget Only on Individual Blogger Posts
Use:
cond='data:view.isPost'
Example:
<b:widget cond='data:view.isPost'
id='HTML2'
locked='false'
title='Post Widget'
type='HTML'
visible='true'>
This is useful for:
- Related Posts
- Post-specific calls to action
- Author boxes
- Article advertisements
Hide a Widget From Individual Posts
Use:
cond='!data:view.isPost'
This can be useful when a homepage widget should remain available elsewhere but should not appear on individual article pages.
Show a Widget Only on Blogger Static Pages
Static pages include pages such as:
About
Contact
Services
Privacy Policy
Use:
cond='data:view.isPage'
Example:
<b:widget cond='data:view.isPage'
id='HTML3'
locked='false'
title='Page Widget'
type='HTML'
visible='true'>
Hide a Widget From All Static Pages
Use:
cond='!data:view.isPage'
For example, a Popular Posts or advertising widget could remain on the homepage and posts while being removed from About, Contact and Privacy Policy pages.
Show a Widget on Posts and Static Pages
Blogger provides:
data:view.isSingleItem
This represents individual content views such as a post or static page.
Example:
<b:widget cond='data:view.isSingleItem'
id='HTML4'
locked='false'
title='Content Widget'
type='HTML'
visible='true'>
This can be useful when the same component belongs on both articles and standalone pages but not on archive-style views.
Show a Widget Only on Search Results
Blogger also provides a search-view condition:
cond='data:view.isSearch'
This can be used when a component is specifically designed for Blogger search or archive-style result pages.
Show a Widget Only on Label Pages
For Blogger Label search pages, use:
cond='data:view.isLabelSearch'
This can be useful for category-specific layouts or additional navigation around label archives.
For example, Blogger category URLs commonly look like:
/search/label/Blogger%20Tips
Show a Widget Only on One Specific Blogger Page
You can compare the current page URL with a specific URL.
For example, to display a widget only on:
https://www.example.com/p/contact.html
use:
cond='data:view.url == "https://www.example.com/p/contact.html"'
Example:
<b:widget cond='data:view.url == "https://www.example.com/p/contact.html"'
id='ContactForm1'
locked='false'
title='Contact Form'
type='ContactForm'
visible='true'>
Replace the example URL with the exact canonical URL of your own page.
Hide a Widget From One Specific Page
Use:
!=
instead of:
==
For example:
cond='data:view.url != "https://www.example.com/p/contact.html"'
This means:
Show the widget everywhere except this URL.
Useful Blogger Widget Conditions
| Condition | Result |
|---|---|
data:view.isHomepage |
Homepage only |
!data:view.isHomepage |
Everything except homepage |
data:view.isPost |
Individual posts only |
!data:view.isPost |
Hide from individual posts |
data:view.isPage |
Static pages only |
!data:view.isPage |
Hide from static pages |
data:view.isSingleItem |
Posts and static pages |
data:view.isSearch |
Search-style views |
data:view.isLabelSearch |
Label pages |
Combine Multiple Blogger Conditions
You can combine conditions using:
and
or
For example, to show something on individual posts or static pages:
cond='data:view.isPost or data:view.isPage'
To display something on search results but exclude label searches:
cond='data:view.isSearch and !data:view.isLabelSearch'
Keep conditions as simple as possible so the template remains easy to maintain.
You Can Also Apply Conditions to Entire Sections
A condition does not have to be limited to one widget.
You can apply it to a Blogger section:
<b:section cond='data:view.isHomepage'
id='homepage-widgets'
showaddelement='yes'>
...
</b:section>
Every widget inside that section will then follow the section condition.
This is useful when your theme contains an entire homepage-only or post-only widget area.
Conditional Tag vs CSS display:none
You may find tutorials that hide Blogger widgets using CSS:
#HTML1{
display:none;
}
That only hides the rendered element visually.
When the purpose is to control whether Blogger should output a widget for a particular page type, a Blogger template condition is usually cleaner:
cond='data:view.isHomepage'
The condition becomes part of the template logic rather than simply hiding the element after it is rendered.
Don't Put Blogger Conditions Inside an HTML/JavaScript Gadget
Blogger template tags such as:
<b:if>
data:view.isPost
data:view.url
belong to Blogger's XML template system.
They should be added through:
Blogger → Theme → Edit HTML
rather than pasted as ordinary content inside the HTML/JavaScript gadget editor.
For normal custom-code gadgets, see our HTML/JavaScript widget guide.
Why Is My Widget Still Showing Everywhere?
Check that the condition was added to the correct opening <b:widget> tag.
For example:
<b:widget cond='data:view.isHomepage' id='HTML1' ...>
Also check:
- You edited the correct widget ID.
- The theme was saved successfully.
- Another copy of the same component does not exist.
- Your browser is not showing an old cached version.
Why Did My Widget Disappear Completely?
If a widget disappears from every page, review the condition carefully.
Common causes include:
- Incorrect condition syntax
- An incorrect URL
- Editing the wrong widget
- Broken XML markup
Restore your theme backup if necessary and apply the condition again carefully.
For more about the Blogger widget structure, see our Blogger widgets and gadgets guide.
Blogger Widget Visibility Checklist
- Back up your Blogger theme.
- Open Theme → Edit HTML.
- Use Jump to Widget.
- Find the correct widget ID.
- Add the
condattribute to the opening widget tag. - Use
isHomepagefor homepage-only widgets. - Use
isPostfor individual posts. - Use
isPagefor static pages. - Use an exact URL condition for one specific page.
- Save the theme.
- Test several different page types.
- Test desktop and mobile views.
Questions About Blogger Widget Visibility
How do I show a Blogger widget only on the homepage?
Add cond='data:view.isHomepage' to the opening b:widget tag in your Blogger theme.
How do I hide a Blogger widget from the homepage?
Use cond='!data:view.isHomepage'. The exclamation mark means the widget should display when the current view is not the homepage.
How do I show a widget only inside Blogger posts?
Use cond='data:view.isPost' on the widget.
How do I show a widget only on Blogger Pages?
Use cond='data:view.isPage' for static Blogger Pages such as About or Contact.
Can I display a Blogger widget on only one specific page?
Yes. Compare data:view.url with the exact URL of that page in the widget condition.
Can I add a visibility condition to an entire Blogger section?
Yes. A cond attribute can also be placed on a Blogger section when every widget inside that section should follow the same visibility rule.
Final Recommendation
Use Blogger's built-in conditional template system when a widget should appear only on certain page types.
For most custom Blogger templates, the conditions you will use most often are:
data:view.isHomepage
data:view.isPost
data:view.isPage
Use exact URL conditions only when a gadget genuinely belongs on one specific page.
Conditional widget rendering keeps your Blogger layout cleaner and gives you much more control than displaying every gadget on every page.