Whenever you click on any label link, a status message “Showing posts with label …. show all posts” shows up. We can remove this message using a simple hack.

Remove alt message

Label message is appearing when we click on any label link. We can use two methods to remove or hide the message “showing posts with label”. First method is by hiding using CSS and second one is by removing corresponding template variable.

showing posts with label
We can remove this message

Blogger uses a variable called data:navMessage for putting this message to your template. We can remove this from your template and the label message won’t be there anymore. But there is a problem with this method, your custom 404 page won’t show up, because Blogger uses the same data:navMessage variable for inserting your custom 404 message.
If you want to keep custom 404 message option from Blogger settings, use the first method to hide the message and if you are OK with removing 404 page, use the second method.

Method 1: Hide “Showing posts with label” message

  • First go to Template > Edit HTML
  • In Blogger default templates, search for <body expr:class='&quot;loading&quot; + data:blog.mobileClass'> and in custom templates, search for <body>
  • Add the below code just after above code.
<b:if cond='data:blog.pageType == &quot;index&quot;'>
<b:if cond='data:blog.searchLabel'>
<style>
.status-msg-wrap{display:none;}
</style>
</b:if>
</b:if>

Your new code will look like this. Now save template and check this hack by clicking on any label link.

remove label status message
Code is added just after body tag

Method 2: Remove Showing posts with label message and custom 404 page option

    • Go to Template > Edit HTML – click on Expand Widget Template
    • Press Ctrl+F and find the following code. If you are not successful, search only the first line
<div class='status-msg-wrap'>
    <div class='status-msg-body'>
      <data:navMessage/>
    </div>
    <div class='status-msg-border'>
      <div class='status-msg-bg'>
        <div class='status-msg-hidden'><data:navMessage/></div>
      </div>
    </div>
  </div>
  • Delete the entire code and Save the template, now check the result by clicking any of your labels

Does this hack work for you? Comments..
Image courtesy: mikesansone


Get free updates in your mailbox..

Share this article