Title: Events list shortcode html output problem
Last modified: August 30, 2016

---

# Events list shortcode html output problem

 *  [janet.ong](https://wordpress.org/support/users/janetong/)
 * (@janetong)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/)
 * Hi Support,
 * I am adding this shortcode to the text editor:
    -  [events_list limit=”4″]
    - #_EVENTIMAGE
    - [/events_list]
 * after when I “Save” the page and the shortcode become
    - [events_list limit=”4″]
    - #_EVENTIMAGE
 * [/events_list]
 * Note the extraneous
    -  tags being added. Kindly need you to advise. Thank you.
 * Best Regards,
    Janet
 * [https://wordpress.org/plugins/events-manager/](https://wordpress.org/plugins/events-manager/)

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

 *  Thread Starter [janet.ong](https://wordpress.org/support/users/janetong/)
 * (@janetong)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6419947)
 * Hi Support,
 * I am adding this shortcode to the text editor:
 *     ```
       <ul>[events_list limit="4"]
       	<li>#_EVENTIMAGE</li>
       [/events_list]
       </ul>
       ```
   
 * after when I “Save” the page and the shortcode become
 *  `<ul>
    <ul>[events_list limit=”4″] <li>#_EVENTIMAGE</li> </ul> </ul> [/events_list]`
 * Note the extraneous `<ul>` tags being added. Kindly need you to advise. Thank
   you.
 * Best Regards,
    Janet
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6420086)
 * Hi Janet,
 * Have you tried putting it on a single line? Like this:
 * `<ul>[events_list limit="4"]<li>#_EVENTIMAGE</li>[/events_list]</ul>`
 *  Thread Starter [janet.ong](https://wordpress.org/support/users/janetong/)
 * (@janetong)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6420128)
 * Hi,
 * Yes, I tried to put it on a single line. But same issue encountered
    🙁
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6420159)
 * Then it’s likely to be a theme issue. Does the same thing happen if you test 
   with the default WordPress theme?
 *  [oleonard](https://wordpress.org/support/users/oleonard/)
 * (@oleonard)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6420167)
 * In my experience the WordPress visual editor consistently rewrites shortcodes
   this way. If you put the shortcode and markup into the text editor and save it,
   the data will be saved correctly. However, when the visual editor redisplays 
   the markup it will be reformatted incorrectly.
 * For example, this markup (all on one line):
 * `<div class="events-list-block"><h3>Upcoming Events</h3><ul>[events_list limit
   ="10" location="1"]<li>#_EVENTLINK - #_EVENTDATES at #_EVENTTIMES</li>[/events_list]
   </ul></div>`
 * Will be reformatted by the visual editor as this:
 *     ```
       <div class="events-list-block">
       <h3>Upcoming Events</h3>
       <ul>
       <ul>[events_list limit="10" location="1"]
           <li>#_EVENTLINK - #_EVENTDATES at #_EVENTTIMES</li>
       </ul>
       </ul>
       [/events_list]
   
       </div>
       ```
   
 * I have resorted to using templates for almost everything because of this problem.
 *  [oleonard](https://wordpress.org/support/users/oleonard/)
 * (@oleonard)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6420176)
 * To complicate things, the rendered HTML of these shortcodes is another thing 
   entirely. Even if you have saved the correct markup to the database, the HTML
   you get on the page is likely to be completely different. Taking the same example,
 *     ```
       <div class="events-list-block"><h3>Upcoming Events</h3><ul>[events_list limit="10" location="1"]<li>#_EVENTLINK - #_EVENTDATES at #_EVENTTIMES</li>[/events_list]</ul></div>
       ```
   
 * The rendered HTML of the resulting page:
 *     ```
       <div class="events-list-block">
       <h3>Upcoming Events</h3>
       <ul>
       <li> ( Event 1 details ) </li>
       <p>
       </p><li> ( Event 2 details ) </li>
       <p>
       </p></ul>
       </div>
       ```
   
 * Note the extra `<p></p>` tags which have appeared out of nowhere.
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6420181)
 * That’s a good point. Have you tried using the Text editor, rather than the Visual
   editor?
 *  [oleonard](https://wordpress.org/support/users/oleonard/)
 * (@oleonard)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6420182)
 * You can use the text editor and it will save the shortcode correctly, but as 
   soon as you switch back to the visual editor (something WordPress often does 
   for you) the content will be reformatted. If you then save the page again without
   realizing what has happened the shortcode will be broken.
 *  Plugin Support [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6420197)
 * oleonard, sorry but maybe you can start your own thread to avoid confusion with
   the original poster?
 * thanks
 *  [oleonard](https://wordpress.org/support/users/oleonard/)
 * (@oleonard)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6420200)
 * I’m not trying to hijack the thread for my own issues, I’m just trying to provide
   more details about an issue which I have struggled with as well.

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

The topic ‘Events list shortcode html output problem’ 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/)

 * 10 replies
 * 4 participants
 * Last reply from: [oleonard](https://wordpress.org/support/users/oleonard/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/events-list-shortcode-html-output-problem/#post-6420200)
 * Status: not resolved