Title: WordPress Shortcode Auto-P Issue
Last modified: August 30, 2016

---

# WordPress Shortcode Auto-P Issue

 *  [DragonSpark](https://wordpress.org/support/users/dragonspark/)
 * (@dragonspark)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/wordpress-shortcode-auto-p-issue/)
 * I am new to WordPress and am implementing a shortcode. My shortcode is super 
   simple and the expected output is HTML5-compliant:
 *     ```
       add_shortcode( 'my_code', function( $attributes ){
               return '<a href="#"><div></div></a>';
           });
       ```
   
 * When this gets emitted, I get the following HTML:
 *     ```
       <a href="#">
           <div></div>
           <p></a>
       ```
   
 * As you can see, there appears to be auto formatting going on. I have followed
   the advice [here](https://wordpress.org/support/topic/automatic-insertion), [here](http://stackoverflow.com/questions/5940854/disable-automatic-formatting-inside-wordpress-shortcodes),
   and have installed [this plugin](https://wordpress.org/plugins/shortcode-empty-paragraph-fix/),
   all to no avail. I am looking for the magic secret that is making this formatting
   occur. Any assistance would be appreciated!

The topic ‘WordPress Shortcode Auto-P Issue’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [DragonSpark](https://wordpress.org/support/users/dragonspark/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/wordpress-shortcode-auto-p-issue/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
