• Adsense
  • Blogger
  • WordPress
  • Social Media
  • SEO
  • Tips
  • Offbeat
Reading: How To Show/Hide Widgets On Specific Pages In Blogger
Share
BlogbeastBlogbeast
Aa
Search
  • Adsense
  • Blogger
  • WordPress
  • Social Media
  • SEO
  • Tips
  • Offbeat
Copyright © 2023 BlogBeast. All Rights Reserved.
blogger

How To Show/Hide Widgets On Specific Pages In Blogger

admin By admin 08/27/2022 7 Min Read
SHARE

There are some situations where you want to show or hide certain widgets on particular pages such as home page, post pages, static pages, archive pages and even on particular posts.So many people have a question such as “How to show/hide widgets on particular pages“.Because there are some widgets which are meant for the home page and some for static pages or post pages.

Let us take an example of AdSense widget. A normal AdSense publisher is allowed to show a maximum of 3 ads(display ads) on each page if you show more than that it may lead to a ban. Also, we are not allowed show AdSense ads inside contact us, privacy policy page. So I’m here to explain to you how to do it. so let’s start to jump into the topic.Follow the steps below.

Step 1:

Go to Blogger Dashboard>Layout and find a widget which you want to show or hide.After finding just give it a unique name which doesn’t match any other widget name and click on save. Generally, we add custom widgets using HTML/CSS widget and use with a particular name to it.

Step 2:

Now click on Template>Edit HTML and check the expand widget in the template or HTML editor.

Step 3:

Next, click ctrl+f and enter the name which you have given in step 1.Let us consider the widget name as Popular posts and click Enter until you find the code which is similar to below code.

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
          Widget code
  </b:includable>
</b:widget>

Here Green highlighted name is the Title of the widget which we are finding and the Red highlighted code is the widget code ( a bunch of code for the widget) which is different for different widgets. In the above code id, title and type are also different for different widgets.Don’t bother about widget code because we are not going to change it.

Step 4:

Now we need to show or hide widget on particular pages.We have to just use a conditional statement to do this job as shown below.

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType != "Page_type"'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

The above code is just a sample code with a conditional statement which is highlighted by Orange color.

Here are the different codes to show or hide widgets on different pages.

To Show Blogger Widget only in Homepage

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType == data:blog.homepageUrl'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

To Hide Blogger Widget only in Homepage

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType != data:blog.homepageUrl'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

To Show a Widget only in Post Pages

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType == "item"'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

To Hide a Widget only in Post Pages

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType != "item"'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

To Show a Widget only in a Specific Page or post

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType == "URL of the page or post"'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

Replace URL of the page or post(which is highlighted with Blue color) with URL of the page or post where you want to show the widget.

To hide a Widget only in a specific Page or post

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType != "URL of the page or post"'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

Replace URL of the page or post(which is highlighted with Blue color) with URL of the page or post where you want to show the widget.

To Show a Widget only in Static Pages

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType == "static_page"'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

To Hide a Widget only in Static Pages

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType != "static_page"'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

To Show a Widget only in Archive Pages

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType == "archive"'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

To hide a Widget only in Archive Pages

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>
    <b:if cond='data:blog.pageType != "archive"'>
      Widget code
    </b:if>
  </b:includable>
</b:widget>

Add this conditional tags to your required widgets and display or hide wherever you want. If you have any queries or getting some problems please ask me in the comment section. Share this with your friends and Subscribe to newsletter for latest post directly in your inbox.

You Might Also Like

How to make a Biolink for Instagram on Blogger

How to add a cookie consent notification to Blogger

Difference between Blogger and WordPress | Best blogging platform in 2022

How To make your blogger theme responsive

How to Add Simple Stylish Recent Posts Widget For Blogger

Share this Article
Facebook Twitter Copy Link Print
By admin
Follow:
Success is no accident. It is hard work, perseverance, learning, studying, sacrifice and most of all, love of what you are doing or learning to do.
Previous Article How to add Google In-Feed Ads in blogger – Easy method
Next Article 10 Best Tips for Indian bloggers – Hindi blogging tips
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

235.3k Followers Like
69.1k Followers Follow
56.4k Followers Follow
136k Subscribers Subscribe

Latest News

What is blogging and how to make money from it?
What is blogging and how to make money from it?
How To Make Money from Blogging
8 Fastest ways on How To Make Money from Blogging
What is wordpress plugin
20 Best WordPress Plugins for your Websites in 2022
How to Uninstall Wordpress Plugins manually
How to Uninstall WordPress Plugins completely with Shortcode

You Might Also Like

How to make a BioLink for Instagram in Blogger
blogger

How to make a Biolink for Instagram on Blogger

4 Min Read
bloggerwidgets

How to add a cookie consent notification to Blogger

4 Min Read
bloggerwordpress

Difference between Blogger and WordPress | Best blogging platform in 2022

9 Min Read
bloggertips

How To make your blogger theme responsive

4 Min Read

Always Stay Up to Date

Follow our Facebook to get our newest articles instantly!

We provide tips, tricks, and advice for improving websites and doing better search.

Quick Links

  • About
  • Disclaimer
  • Privacy Policy
  • Write for us

Resouce

  • About
  • Disclaimer
  • Privacy Policy
  • Write for us

Get the Top 10 in Search!

Looking for a trustworthy service to optimize the company website?
Request a Quote

Removed from reading list

Undo
Welcome Back!

Sign in to your account

Lost your password?