Title: [Plugin: Widget Logic] Hiding a widget without content
Last modified: August 19, 2016

---

# [Plugin: Widget Logic] Hiding a widget without content

 *  [Jamil Jonna](https://wordpress.org/support/users/jonna/)
 * (@jonna)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-hiding-a-widget-without-content/)
 * Hello,
 * I’m just trying to hide a widget (YARPP) when there isn’t any content. I style
   my widget areas with borders and they still appear when a widget has no content.
   Can widget logic do this?
 * Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-hiding-a-widget-without-content/#post-1646673)
 * It can help
 * you could use logic that returns false under the circumstances that the content
   is empty, of if that logic is too complex you could use the widget_content filter.
   you’d have to write a function that tested if the full HTML content of the widget
   was empty, and then return an empty string
 *  Thread Starter [Jamil Jonna](https://wordpress.org/support/users/jonna/)
 * (@jonna)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-hiding-a-widget-without-content/#post-1646708)
 * Unfortunately I’m not equipped to write such a function. But you’d think this
   would be a useful feature of widget logic. Do you happen to know if anyone has
   attempted it? Or could you suggest where I might start? I’ve created filters 
   before but very basic ones. I don’t know how to test for HTML content or how 
   to say “don’t show the widget”.
 * Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Widget Logic] Hiding a widget without content’ is closed to 
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/widget-logic_c8dde5.svg)
 * [Widget Logic](https://wordpress.org/plugins/widget-logic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-logic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-logic/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-logic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-logic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-logic/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jamil Jonna](https://wordpress.org/support/users/jonna/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-widget-logic-hiding-a-widget-without-content/#post-1646708)
 * Status: not resolved