✅ New Blogger Conditional Tags and How to Use Them - Rotkx

New Blogger Conditional Tags and How to Use Them

New Blogger Conditional Tags and How to Use Them

New Blogger Conditional Tags and How to Use Them – Showing or hiding code on specific pages of your blog is the most suitable solution if your template contains a lot of code 👌. Because if there are many scripts that serve no purpose on certain pages, they will reduce the loading speed of your blog 😞. As a result 🧐, your blog will load very slowly 🐢, and visitors may get bored waiting for it to load 😐.


Conditional tags are used to show ✅ or hide ❎ a specific widget or piece of code on a particular page. For example 🌝: you may want to show the sidebar on the homepage, but not on individual post pages 🙄. In this case 🤗, you’ll use the appropriate conditional tag 😎.


Here are the new Blogger conditional tags that you can use to wrap specific code blocks.


New Blogger Conditional Tags and How to Use Them


Conditional Tags

Homepage Only


Shows the code on the homepage only.


<b:if cond='data:view.isHomepage'> ... </b:if>

Homepage and Related Pages


Displays the code on all pages related to the homepage, such as label pages, pagination, but not on post pages or static pages or 404 pages.


<b:if cond='data:view.isMultipleItems'> ... </b:if>

Post and Page View


Displays the code on both post pages and static pages.


<b:if cond='data:view.isSingleItem'> ... </b:if>

Post Page Only


Displays the code on post pages only.


<b:if cond='data:view.isPost'> ... </b:if>

Static Page Only


Displays the code on static pages only.


<b:if cond='data:view.isPage'> ... </b:if>

Label View


Displays the code when viewing any label page inside the blog.


<b:if cond='data:view.isLabelSearch'> ... </b:if>

Search Page Including Labels


Displays the code when searching for posts or viewing a label page.


<b:if cond='data:view.isSearch'> ... </b:if>

Search Page Excluding Labels


Displays the code when performing a search but not when viewing a label page.


<b:if cond='data:view.isSearch and !data:view.isLabelSearch'> ... </b:if>

Archive Page


Displays the code when using the archive widget.


<b:if cond='data:view.isArchive'> ... </b:if>

Error Page (404)


Displays the code when a user lands on a broken link (404 page).


<b:if cond='data:view.isError'> ... </b:if>

Mobile View


Displays the code when using a phone or tablet.


<b:if cond='data:view.isMobile'> ... </b:if>

Preview Mode


Displays the code while previewing a post or the template before saving — visible only to blog admins and authors.


<b:if cond='data:view.isPreview'> ... </b:if>

Layout Page (Design Mode)


Displays the code inside the layout editor — visible only to blog admins.


<b:if cond='data:view.isLayoutMode'> ... </b:if>



How to Use Conditional Tags


To use conditional tags, place your desired code between them, replacing the three dots.


For example: I want to show a certain code block only on post pages. I’ll delete the three dots and maintain proper indentation for neatness.


<b:if cond='data:view.isPost'>
Place your code here
</b:if>

If the code is CSS, wrap it inside <style> and </style> tags.

If you want to **prevent** code from appearing on a specific page, simply add an exclamation mark ! like this:


<b:if cond='!data:view.isPost'>
Place your code here
</b:if>

This means: Show the code on all pages **except** the post page.


This concludes the explanation of New Blogger Conditional Tags and How to Use Them. Sorry for the long post, and we hope it was useful 😊.


Thanks for reading 💖 Let us know your thoughts in the comments 💬.

Copyright © Rotkx 2017-2025