How to Display or Hide Widgets on Specific Pages and Posts

In this post I will cover 2 plugins which can be used to conditionally display widgets on specific pages. There are a lot of use cases for conditionally displaying widgets. For example if you want to display the login widget on particular pages, then you can do so easily with these plugins

Using the Display Widget Plugin (link)

The Display Widget Plugin is immensely popular. It has been downloaded half a million times and has rating of 4.8.

Using the plugin is quite straight forward. Just Install and activate the plugin.

Activating the plugin will add more options to your widgets. Refer to the following screenshot

Display Widget Plugin Screen

As you can see , the plugin allows you to quickly display / hide widgets on selected pages. One can also choose to display widgets to only logged-in or logged out users. This is a very intutitive plugin, The only thing which bothers me is that this plugin was updated almost an year ago.

Using the Widget Logic Plugin (link)

This is another very popular plugin. It has been downloaded more than 900,00 times and has a rating of 4.9 .

Installing this plugin will append a logic box to every widget. Refer to the screenshot.

Widget Logic Screen

One can input now input condition (s) in the logic box. So for example if you want to display the widget on page with ID 42, then simply use the logic is_page (42). This will ensure that the widget appears only on the respective page.

One can also enter multiple conditions. For example  is_page (42) || is_page (81)   will display widget on page with id 42 and 81. This is a very powerful plugin, you can also use this plugin to display the widget on category pages, on custom post type etc.

If you have any questions then ask in the comments.

Did you enjoy this article?
We regularly publish WordPress related Tutorials and Tips on this blog. Signup today and receive free updates straight in your inbox.
I agree to have my personal information transfered to Mad Mimi ( more information )
About Ankit

Founder of SpiceWp. We share useful Wordprss Tips and Tricks.

I have also released 17 Wordpress Plugins till date .

I regularly publish Wordpress related Tutorials and Tips on this blog.
If you like the content then consider subscribing to the blog here.

Speak Your Mind

*