Title: shortcode autop
Last modified: August 21, 2016

---

# shortcode autop

 *  [lieutenantdan](https://wordpress.org/support/users/lieutenantdan/)
 * (@lieutenantdan)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-autop/)
 * Whenever I try disabling WordPress’s auto p for shortcodes it always stays on.
   It randomly inserts <p> tags inside an anchor tag and starts to create unexpected
   results.
 * I’ve tried moving the autop to after shortcodes using filters already and nothing
   yet.

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

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-autop/#post-4022615)
 * How are you attempting to disable `wpautop`?
 * Are you putting this in your theme’s `functions.php` file?
 *     ```
       remove_filter( 'the_content', 'wpautop' );
       remove_filter( 'the_excerpt', 'wpautop' );
       ```
   
 * [http://codex.wordpress.org/Function_Reference/wpautop#Disabling_the_filter](http://codex.wordpress.org/Function_Reference/wpautop#Disabling_the_filter)
 *  Thread Starter [lieutenantdan](https://wordpress.org/support/users/lieutenantdan/)
 * (@lieutenantdan)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-autop/#post-4022679)
 * That works although I still want to keep the autop in posts and pages, just not
   in my shortcodes.
 * This is one attempt,
 *     ```
       //move wpautop filter to AFTER shortcode is processed
       remove_filter( 'the_content', 'wpautop' );
       add_filter( 'the_content', 'wpautop' , 99);
       add_filter( 'the_content', 'shortcode_unautop',100 );
       ```
   

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

The topic ‘shortcode autop’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [lieutenantdan](https://wordpress.org/support/users/lieutenantdan/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-autop/#post-4022679)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
