Title: plugin inserts p tag when using parameters
Last modified: January 14, 2021

---

# plugin inserts p tag when using parameters

 *  [joshmacd](https://wordpress.org/support/users/joshmacd/)
 * (@joshmacd)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/plugin-inserts-when-using-parameters/)
 * Short code in post:
    `[sc name="123" pros="<li>Great for video making</li>"]`
 * short code in shortcoder:
 *     ```
       <div class="pros"><h5>Pros:</h5>
             <ul>
               %%pros%%
             </ul>
           </div>
       ```
   
 * HTML rendered:
 *     ```
       <div class="pros"><h5>Pros:</h5>
             <ul>
               </p>
       <li>Great for video making</li>
       </ul>
       </div>
       ```
   
 * Why is the plugin adding in a useless </p> tag? It’s not valid HTML.
    -  This topic was modified 5 years, 4 months ago by [joshmacd](https://wordpress.org/support/users/joshmacd/).

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

 *  Plugin Author [vaakash](https://wordpress.org/support/users/vaakash/)
 * (@vaakash)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/plugin-inserts-when-using-parameters/#post-13908806)
 * Hi [@joshmacd](https://wordpress.org/support/users/joshmacd/),
 * That `</p><p>` is added by WordPress when the content is displayed on the front.
 * WordPress adds `<p>` tag to automatically replace lines which have line breaks.
 * In this case for some reason the parser add `</p>` before `<li>` and `<p>` after`
   </li>`.
 * The immediate workaround would be to just disable this feature. Note that this
   may disable adding p tags on the front for older posts which has no p tags.
 * [https://stackoverflow.com/questions/22710524/stop-wordpress-automatically-showing-p-p-tags](https://stackoverflow.com/questions/22710524/stop-wordpress-automatically-showing-p-p-tags)
 * The other workaround is to simply not use HTML in shortcode parameters and use
   plain text and then use HTML in the shortcode content.
 * I’ve added this to my todo list to over come this issue.
    I’ll work on this handle
   this in the next version.
 * Thanks,
    Aakash
    -  This reply was modified 5 years, 4 months ago by [vaakash](https://wordpress.org/support/users/vaakash/).
 *  Thread Starter [joshmacd](https://wordpress.org/support/users/joshmacd/)
 * (@joshmacd)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/plugin-inserts-when-using-parameters/#post-13910196)
 * I think I have to use HTML because I’m trying to pass a list of texts and the
   lengths differ.
 * I don’t think shortcoder has loops does it?
 * Sometimes I’m passing
 * word1,word2,word3
 * or
 * word1,word2
 * so i put them in li tags when i send them
 * is there a better way?
 *  Plugin Author [vaakash](https://wordpress.org/support/users/vaakash/)
 * (@vaakash)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/plugin-inserts-when-using-parameters/#post-13955306)
 * Hi [@joshmacd](https://wordpress.org/support/users/joshmacd/),
 * Sorry for the late reply.
 * Yes, the content inside shortcode content cannot be programatically controlled.
   Using custom parameters is the way.
 * I’ll try to handle this in the next version.
 * Meantime can you please temporarily disable automatic addition of `<p>` tags ?
 * [https://stackoverflow.com/a/22710688/306961](https://stackoverflow.com/a/22710688/306961)
 * I’ll try to issue a fix by next weekend.
 * Thanks,
    Aakash

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

The topic ‘plugin inserts p tag when using parameters’ is closed to new replies.

 * ![](https://ps.w.org/shortcoder/assets/icon.svg?rev=2222236)
 * [Shortcoder — Create Shortcodes for Anything](https://wordpress.org/plugins/shortcoder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcoder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcoder/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcoder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcoder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcoder/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [vaakash](https://wordpress.org/support/users/vaakash/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/plugin-inserts-when-using-parameters/#post-13955306)
 * Status: not resolved