Title: formatting incorrect with shortcode adding line breaks
Last modified: August 21, 2016

---

# formatting incorrect with shortcode adding line breaks

 *  Resolved [jaysee412](https://wordpress.org/support/users/jaysee412/)
 * (@jaysee412)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/formatting-incorrect-with-shortcode-adding-line-breaks/)
 * For example [http://popgh.com/events/](http://popgh.com/events/) should look 
   like [http://demo.wp-events-plugin.com/events/](http://demo.wp-events-plugin.com/events/)
   so i emailed the them designer to see if they had any suggestion and they said
   the following:
 * That’s because for every carriage return in the event shortcode WordPress is 
   adding a br or a p tag which is causing the line breaks that you are seeing. 
   The theme applies the built-in WordPress filters to all shortcodes and content
   entered into any of the page content areas, which includes rendering carriage
   returns as br and p tags. I’m not exactly sure how to tell WordPress not to use
   these filters for plugins, but if I can figure out a way to do this I will update
   the theme with this. If you figure anything out regarding this I would appreciate
   the info!
 * [http://wordpress.org/extend/plugins/events-manager/](http://wordpress.org/extend/plugins/events-manager/)

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

 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/formatting-incorrect-with-shortcode-adding-line-breaks/#post-3917109)
 * hmm, I think the problem is that your theme is adding extra p and br tags; maybe
   you can ask your theme provider on how you can turn this off.
 *  Thread Starter [jaysee412](https://wordpress.org/support/users/jaysee412/)
 * (@jaysee412)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/formatting-incorrect-with-shortcode-adding-line-breaks/#post-3917144)
 * I’m not disagreeing totally. I found a lot of hits regarding this being a wordpress
   issue that it filters or reads it how it wants and throws in its own code. I 
   have not really found a solution. The theme creator offered to add it into next
   version if he or i can come up with a solution to that but he was not sure. I’m
   not a programmer so I’m stuck but is this helpful?
 * [http://seven.collective-b.org/2008/01/09/wordpress-and-adding-line-breaks/](http://seven.collective-b.org/2008/01/09/wordpress-and-adding-line-breaks/)
 * I even read about people having to clean all the carriage returns out of the 
   code to get the wordpress filter from adding code.
 * Thanks for ANY help you can give.
 *  [Philip John](https://wordpress.org/support/users/philipjohn/)
 * (@philipjohn)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/formatting-incorrect-with-shortcode-adding-line-breaks/#post-3917171)
 * Hiya,
 * A quick and simple way to test whether this issue is a theme or WordPress one
   would be to revert to the default theme temporarily. If the extra returns remain,
   you know it’s a WordPress (or plugin) issue, rather than your theme. Otherwise,
   it’s your theme and you can ask the developer to fix it.
 * In my test site, using the default theme, I do not get this issue, which suggests
   that it is caused by your theme or a plugin.
 * So, if you DO see the issue in the default theme, it’s likely to be a plugin 
   causing the problem. You’ll need to disable plugins one-by-one until the issue
   goes away to find out which one it is. Then, you can inform the plugin developer
   so that a fix can be found.
 * Let us know how you get on!
 * Cheers,
    Phil
 *  Thread Starter [jaysee412](https://wordpress.org/support/users/jaysee412/)
 * (@jaysee412)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/formatting-incorrect-with-shortcode-adding-line-breaks/#post-3917183)
 * ok so i went to my test site and installed the theme. had issue there also. i
   disabled all plugins but still had issue.
 * switch the theme and it looked ok.
 * so yes its something with theme that effecting some plugins. odd that the test
   site looks fine that the theme editor has up when i test it there.
 * the editor is stumped also but willing to help. not sure where to start.
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/formatting-incorrect-with-shortcode-adding-line-breaks/#post-3917186)
 * Try adding this to the functions.php file of your theme:
 * `remove_filter ('the_content', 'wpautop');`
 *  Thread Starter [jaysee412](https://wordpress.org/support/users/jaysee412/)
 * (@jaysee412)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/formatting-incorrect-with-shortcode-adding-line-breaks/#post-3917210)
 * that didnt seem to help or hurt the layout any.
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/formatting-incorrect-with-shortcode-adding-line-breaks/#post-3917242)
 * maybe you need to wrap it in another filter so it gets executed later, e.g.
 *     ```
       function remove_wpautop(){
         remove_filter ('the_content', 'wpautop');
       }
       add_filter('init', 'remove_wpautop');
       ```
   

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

The topic ‘formatting incorrect with shortcode adding line breaks’ is closed to 
new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 7 replies
 * 5 participants
 * Last reply from: [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/formatting-incorrect-with-shortcode-adding-line-breaks/#post-3917242)
 * Status: resolved