Widget Logic

Best Wordpress Widget and Gutenberg Block Control Plugin. Control your site’s sidebar widgets and all Gutenberg blocks on pages & posts with ease

Features

Widget Logic Features

Manage Widget & Gutenberg Block Visibility

Effortlessly manage visibility and access across different pages, posts, and categories with the Widget Logic plugin.

Fully Free

Use Widget Logic completely free for all your websites.

User Login State

Decide which widgets or Gutenberg blocks should be visible or hidden to either logged-in or non-logged-in users.

Load Logic

Set the point in the page load at which your widget logic if first checked.

About

Widget Logic helps you to improve your websites

This plugin gives every widget an extra control field called “Widget logic” that lets you control the pages that the widget will appear on. The text field lets you use WP’s Conditional Tags, or any general PHP code.

PLEASE NOTE The widget logic you introduce is EVAL’d directly. Anyone who has access to edit widget appearance will have the right to add any code, including malicious and possibly destructive functions. There is an optional filter ‘widget_logic_eval_override’ which you can use to bypass the EVAL with your own code if needed.

Learn More
about-image
PRICING

You can use Widget Logic plugin and all its features completely free!

shape
FAQ

Any Questions? Answered

Yes, you can! Starting from 6.0.0 you can use Widget Logic in Gutenberg widgets and in Classic Widgets. So if you have earlier version, please update plugin.
You have a PHP syntax error in one of your widget’s Widget Logic fields. Review them for errors. You might find it easiest to check by using ‘Export options’ and reading the code there (Though be aware that single and double quotes are escaped with multiple backslash characters.)
This is often, not always, fixed by trying the different ‘Load Logic’ options. The ‘after query variables set’ option looks like it might be a better default, try it.
I believe this is fixed in 5.7.0. Let me know if that is not the case. If your theme calls the sidebar after the loop you should find that the wp_reset_query option fixes things. This problem is explained on the is_page codex page.
This is sort of deliberate. I originally wrote it to be as flexible as possible with the thought of writing a drag’n’drop UI at some point. I never got round to it, because (I’m lazy and) I couldn’t make it both look nice and let you fall back to ‘pure code’ (for the possibilities harder to cater for in a UI). The plugin Widget Context presents a nice UI and has a neat ‘URL matching’ function too.
It might be that your theme performs custom queries before calling the sidebar. Try the wp_reset_query option. Alternatively you may have not defined your logic tightly enough. For example when the sidebar is being processed, in_category(‘cheese’) will be true if the last post on an archive page is in the ‘cheese’ category. Tighten up your definitions with PHPs ‘logical AND’ &&, for example: is_single() && in_category('cheese')
Testimonials

What our Users Say

"Widget Logic is a superb plugin, but had not been updated for years. So I am delighted that it has been brought up to date. Thanks for taking it over, it has been hugely useful to me for years and I had worried that it would just disappear one day"

author

Easton Bavents

@microbe

“Just found today that I can add !wp_is_mobile() to remove widgets from showing on mobile device browsers. Very handy since most of the sidebar widgets only fit well on desktop. Been using this plugin for several months now and it works great"

author

starvoters1

@starvoters1

“This works great. Minor “coding” required. Allowed me to select which widgets I wanted on the side bar for certain pages! I was searching plugin like this for a long time. And now i finnaly got it. Big thanks to developers. Doing a great job!"

author

cbkuhn

@cbkuhn

CONTACT US

Let’s talk about
Love to hear from you!

How Can We Help?

[email protected]