Title: Function is not working in Widgets
Last modified: August 24, 2016

---

# Function is not working in Widgets

 *  [Joren Wouters](https://wordpress.org/support/users/jorenman/)
 * (@jorenman)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/function-is-not-working-in-widgets/)
 * Hello everyone,
 * I am making a shortcode for my theme, but there is a problem.
    When I am making
   this shortcode, there comes automatically a  tag after it. I solved this problem
   with this function:
 *     ```
       remove_filter( 'the_content', 'wpautop' );
       remove_filter( 'the_excerpt', 'wpautop' );
   
       function wpse_wpautop_nobr( $content ) {
           return wpautop( $content, false );
       }
       add_filter( 'the_content', 'wpse_wpautop_nobr' );
       add_filter( 'the_excerpt', 'wpse_wpautop_nobr' );
       ```
   
 * But the problem is that this function does not work in Widgets, does anyone know
   how to make this function work in widgets?
 * Greets,
 * Joren

The topic ‘Function is not working in Widgets’ is closed to new replies.

## Tags

 * [<br>](https://wordpress.org/support/topic-tag/br/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 0 replies
 * 1 participant
 * Last reply from: [Joren Wouters](https://wordpress.org/support/users/jorenman/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/function-is-not-working-in-widgets/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
