Title: Doesn&#039;t work on a widget
Last modified: August 22, 2016

---

# Doesn't work on a widget

 *  Resolved [DragoWeb](https://wordpress.org/support/users/dragoeco/)
 * (@dragoeco)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/doesnt-work-on-a-widget/)
 * Hi, I am trying to use this plugin. I followed the each steps here ([http://adblockingdetector.jtmorris.net/using-ad-blocking-detector/](http://adblockingdetector.jtmorris.net/using-ad-blocking-detector/))
   but when I place the shortcode [adblockingdetector id=”1″] inside a widget, it
   only display “[adblockingdetector id=”1″]” but not the content set in the plugin.
   Do I made something wrong? Do I have to activate shortcode? Thanks
 * [https://wordpress.org/plugins/ad-blocking-detector/](https://wordpress.org/plugins/ad-blocking-detector/)

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

 *  [John Morris](https://wordpress.org/support/users/jtmorris/)
 * (@jtmorris)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/doesnt-work-on-a-widget/#post-5372938)
 * Hi dragoeco,
 * It sounds as if your text widgets aren’t set to parse shortcodes. By default,
   WordPress text widgets do not do this. In order to enable shortcodes in text 
   widgets, you must add the following code to your theme’s _functions.php_ file.
 *     ```
       add_filter('widget_text', 'do_shortcode');
       ```
   
 * If you haven’t done that already, the easiest way to do so is within your WordPress
   dashboard. Under the Appearance menu entry, click Editor. Then, make sure your
   theme is selected, and find functions.php in the list of files. Then, add the
   above code to that file. The easiest thing to do is to add it at the bottom.
 * If you have already done this, and the shortcode still isn’t working, let me 
   know, and I’ll look into it further.
 *  Thread Starter [DragoWeb](https://wordpress.org/support/users/dragoeco/)
 * (@dragoeco)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/doesnt-work-on-a-widget/#post-5372944)
 * It works, I edited the function.php file from the template folder with Notepad
   ++ and added this line at the bottom :
    ‘add_filter(‘widget_text’, ‘do_shortcode’);’
   and everything works fine now. Thanks a lot for this great plugin and for you
   fast answer John 🙂
 *  [John Morris](https://wordpress.org/support/users/jtmorris/)
 * (@jtmorris)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/doesnt-work-on-a-widget/#post-5372977)
 * Glad it worked!
 * Let me know if you encounter any other issues or have suggestions!
 *  [John Morris](https://wordpress.org/support/users/jtmorris/)
 * (@jtmorris)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/doesnt-work-on-a-widget/#post-5373014)
 * Just for your information (and anyone else who reads this thread), I released
   an update to this plugin which adds a widget.
 * Now, when editing your sidebar widgets, there will be an additional option (called
   Ad Blocking Detector). This widget allows you to choose, from a dropdown, which
   shortcode you want to display and position it on your sidebar.
 * The text widget method still works, and it provides some additional flexibility.
   But, just so you’re aware, there is now another option.
 * You can find some screenshots and a short explanation here: [http://adblockingdetector.jtmorris.net/new-feature-sidebar-widgets/](http://adblockingdetector.jtmorris.net/new-feature-sidebar-widgets/)

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

The topic ‘Doesn't work on a widget’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ad-blocking-detector_466992.svg)
 * [Ad Blocking Detector](https://wordpress.org/plugins/ad-blocking-detector/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-blocking-detector/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-blocking-detector/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-blocking-detector/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-blocking-detector/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-blocking-detector/reviews/)

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 4 replies
 * 2 participants
 * Last reply from: [John Morris](https://wordpress.org/support/users/jtmorris/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/doesnt-work-on-a-widget/#post-5373014)
 * Status: resolved