How to Show or Hide Widgets on Specific Pages

If you’re new to WordPress, this will take your site to the next level. You’ll love the new flexibility and control you have for customizing your site.

In particular, you’ll learn how to:

  • show a widget on your homepage only
  • show a widget on one category
  • hide a widget on your homepage
  • show a widget on one page
  • show a widget on one post

The Widget Options Plugin

To control your widget display, I recommend using the awesome Widget Options plugin.

Widget Options

Widget Options makes it very easy to show or hide any widget on any type of page. It provides a robust set of settings but is still simple to learn and use.

Update: I previously recommended the Display Widgets plugin in this post. However, that plugin has since been taken over by new developers who have been caught injecting spam into thousands of sites via the plugin. Please avoid the Display Widgets plugin and use Widget Options instead.

In this tutorial, I’ll be demonstrating with the Widget Options plugin. Now, let’s get to the first way you can use this plugin.

How to show a widget on the homepage only

Let’s say you have a welcome message you want to be displayed on the homepage only.

To do this, you would first add a Text widget to the widget area. Then, with Widget Options installed, you’ll see the following options added to the widget:

Widget Options Example

To show the widget on the homepage only, switch the Hide/Show option to “Show on checked pages,” check the Home/Front option, and save the widget.

Widget Homepage Only

The widget will now only show on the homepage, whether you’re displaying a static page or your posts.

How to show a widget on a category only

Showing a widget on one category is just as easy.

Add your widget, and once again, set the first option to Show on checked pages. This time, click on the Taxonomies tab and then check the box of the category you want to display the widget on.

Widget Show Category

Lastly, save the widget and its display settings will be updated.

How to hide a widget on the homepage

Instead of showing a widget on the homepage only, you can reverse this and hide a widget on the homepage only.

To hide a widget on the homepage, the options are the same as showing it on the homepage, but this time you switch the Hide/Show option to “Hide on checked pages.”

Widget Hide Homepage

Now the widget will show on every page except for the front page.

How to show a widget on a specific page

By now, you should have a pretty good idea of how this works.

If you want to show a widget on one page only, you can switch to the Post Types tab and there you’ll find all of the pages published on your site.

Widget Show Page

 

Conclusion

We’ve only scratched the surface.

With the Widget Options plugin, you can hide/show widgets based on the visitor’s device, hide the title for any widget, and add new classes for custom CSS styling. There’s an unlimited variety of ways you can use it to customize the content shown on your site.

Related Posts

10 Comments

  1. Cool plugin Jeff, thanks for sharing!

  2. Craig Craig

    What if the post has more than one category and I want the widget to show up only on the primary category?

    Example: I have 3 categories and 9 posts. Each post has 2 categories. In this case, setting the visibility to one category will show two widgets for each post because they are in two categories. How do I make the widget show up only on the primary category?

    • Hi Craig,

      There are two ways you could do this. First, you could show each widget based on a list of post IDs. This would work well, but would require you to update the IDs list when you publish new posts. The second option is to add a new set of 3 categories used specifically for the widgets. If there is no overlap on these categories, then you can use them to categorize the posts based on which widget should be shown.

  3. Hi,

    No problem 🙂 Just want to update the link. It’s not hosted here http://widget-options.com/ with the free version the repository : https://wordpress.org/plugins/widget-options

    I hope this will be very helpful. Thanks!

  4. Is it free or paid plugin? If paid whats the cost of plugin?

    • Hey John,

      Each of the plugins listed are free to use on your site.

  5. I see a lot of interesting articles on your website. especially this article related to my problem You have to spend a lot of time writing many articles, thank you for your articles, today learn so much from this post.

  6. Hey Ben,
    Thanks for replying. Really appreciate that

  7. I love the Display Widget. I think that is the best and easy to use.

Post a comment

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