If you’re using WordPress, you’re probably using more than one widget on your website. It doesn’t matter if you want to show information on the sidebar or you simply want to add a Google Map location, widgets are there to help you. But once you activate a widget, it will be present on every page of your website.
But what if you want to display a widget (for example one for displaying recent posts) only on one page? Since there isn’t an option to do that, you will have to code it yourself or, of course, install a plugin which will do it for you.
In this article, we are about to show you how to control the visibility of a widget easily by installing a free plugin.
There are many plugins which will do practically the same job, but for this occasion, we have chosen Dynamic Widgets. This free plugin will let you choose pages on which your widget will be shown, plus, you can dynamically change widgets’ visibility depending on conditions. Of course, you won’t have to code anything – everything can be done with choosing the desired options in the settings area.
Those conditions can include roles, browsers, mobile device, date, and much more.
- Navigate to Plugins->Add New
- Search for “Dynamic Widgets” plugin
- Install and activate it
- Go to Appearance->Dynamic Widgets where you can change plugin’s settings
Here, you will get a list of your active widgets. Select a widget you want to edit and the plugin will open a set of options for you.
Role: choose roles for which the widget will be visible. For example, only admins can see a widget
Date: choose dates on which the widget is being displayed
Days: select days on which the widget will be visible
Weeks: select weeks in a year on which the widget will be visible
Browser: choose browsers which will show/hide the widget. This option isn’t 100% accurate.
IP address: select one IP address or an entire range for which the widget will be shown
Device: choose if the widget will be displayed on desktop and/or mobile devices
Templates: If your theme has many templates, you can choose on which template to show the widget (for example, only full-width)
URL: specify URLs on which widget will be displayed/hidden
Posts Page: choose if you want your widget to be shown on posts page
Single posts: choose if a widget will be displayed on single posts and define users and categories for which it will be visible
Attachments: choose if you want your widget to be displayed on attachments pages
Pages: choose static pages which will display the widget
Author Pages: choose which author pages will display the widget
Category Pages: choose category pages which will display the widget
Tag Pages: Choose tag pages which will display the widget
Archive Pages: choose if you want the widget to be visible on archive pages
Error Page: choose if you want the widget to be visible on error page
Search Pages: choose if you want the widget to be visible on search pages
If you have more pages installed by some plugins, for example, optin pages if you use Optin Ninja premium WordPress plugin, there will be extra fields in the settings area where you can choose to show or hide selected widget. This can be done for every widget you have installed so take your time and control how your widgets are being displayed.