Widget is quite common and the most popular application commonly used on WordPress to keep track of various data, statistics, conversion rates, updates, and many more on the WordPress site. Most themes come with different kinds of widgets for the WordPress home page, landing page, login page, and many more. It helps you look your site more modern and up to the trend. In the upcoming article, let’s see how to show or hide widgets on Specific WordPress Pages.
Ways to Show or Hide Widgets on WordPress Specific Pages
There are two possible ways to display or hide widgets on your WordPress specific pages and they are
- Show or Hide Widgets without Plugin
- Show or Hide Widgets with Plugins
Show or Hide Widgets on Specific WordPress Pages Without Plugin
[1] From your WordPress dashboard, go to Appearance from the left panel. [2] Choose Theme Editor/Editor from the Appearance menu.

//Hide widget in WordPress add_filter( 'widget_display_callback', 'hide_widget_pages', 10, 3 ); function hide_widget_pages( $instance, $widget, $args ) { if ( $widget->id_base == 'xxxx' ) { // change 'xxxx' to widget name if ( !is_page( 'yyyy' ) ) { // change 'yyyy' to page name return false; } } }
Note: To find the Widget ID, go to the page where the widget is available and right-click on the page. Choose Inspect from the context menu. Now press Select the element icon (or) Ctrl + Shift + C on the keyboard. Click on the Widget to inspect the code. Here you can find the ID for the widget (<div id=”widget ID name“…..</div>).

//Show widget in WordPress add_filter( 'widget_display_callback', 'show_widget_pages', 10, 3 ); function show_widget_pages( $instance, $widget, $args ) { if ( $widget->id_base == 'xxxx' ) { // change 'xxxx' to widget name if ( !is_page( 'yyyy' ) ) { // change 'yyyy' to page name return false; } } }[5] Once the code is entered, click on Update Files to apply changes. [6] Now you can successfully show or hide widgets on WordPress pages.
Related: How to Add WordPress Dark Mode [The Simplest Way]
Show or Hide Widgets on Specific WordPress Pages With Plugin
There are several plugins out there, in the WordPress plugin store that can be used to hide or show widgets on WordPress pages. Here, we are using the Widget Context plugin, so make sure to install and active the plugin by Plugins >> Add New >> Widget Context >> Install Now >> Activate.



Apart from Widget Context, there are several other plugins available to hide or show widgets and they are
Also, see How to Display Relative Dates in WordPress | Guide 2022
Conclusion
Hope this guide helps you find ways to show or hide Widgets on your WordPress site. Showing widget helps you keep track of several kinds of site data up to date. Hiding widgets may help you in speeding up the page and get a better conversion rate to your website. If you have any queries, let us know in the comments section below. For more WordPress guides and articles, explore the site.