Do you want to hide a widget on a specific WordPress page or post? If so, you’re in the right place.
I’m currently making some changes to my blog. Specifically, I’ve just added a start here page to the site, and …
I want to hide the WordPress widget that has a picture of me and a link to the about page, so I can use the same image on the new page I just created.
So, I thought, what the heck. I may as well kill two birds with one stone and show you how to do the same.
First though, just so you know, I would never actually kill a bird, ever. lol 🙂 I love birds. And dogs. And cats. But I digress …
In this article, I will show you how to easily hide a widget, or show a widget, on specific WordPress pages and posts.
How to Hide a Widget On WordPress Pages
Once activated, go to Appearance >> Widgets. Open up the widget you want to hide, and you’ll now see a new section at the bottom of the widget, like this:
To hide a widget on a specific WordPress page, select ‘hide on checked pages’. Then, select the page you want to hide, and save your changes.
Or, if you just want to hide a widget on an archive page, like the blog page for example, you can. Just switch to the Misc tab and make your selection.
Now, save your changes and view your site to see the plugin in action. 🙂
How to Hide a Widget On WordPress Posts
You can also use the Widget Options plugin to hide a widget on specific posts by adding WP Conditional Tags to the Logic tab setting, like this:
Now, as you can see, hiding widgets on posts is not as easy as hiding widgets on pages, but worry not my friend, I will give you the exact conditional tag to copy and paste, and explain how it works.
So, for example. If I wanted to hide a widget on this post only, I would add the following code:
But if I wanted to hide a widget on three specific posts, I would add this code instead:
!is_single(array('2329', '2311', '2238'))
The numbers you see in both examples above are the ID numbers of the specific posts I wish to hide a widget on. So, all you have to do is copy and paste one of the codes above and add your own post ID numbers.
To find your WordPress post ID, go to All Posts and hover over the post title you want to hide a widget on. Then, at the bottom of the screen you’ll see the post ID included in the edit post URL, like this:
When you’ve replaced my post ID’s with yours, save your changes and visit your site to confirm the widget is indeed hidden from your chosen posts.
And that’s it. That’s how you hide a widget from specific WordPress posts and pages. I hope this article has helped.
If you liked this article, enter your email below to join my weekly WordPress newsletter, and I’ll let you know when new tutorials are added to the blog.