Title: Closing &#8211; tag
Last modified: February 22, 2018

---

# Closing – tag

 *  Resolved [clgrmn](https://wordpress.org/support/users/clgrmn/)
 * (@clgrmn)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/closing-tag/)
 * Why is it that WordPress can’t handle my <main> – tag?!
    I have already checked
   every single tag if it is closed.
 * I’ve got following site structure:
 * <main>
    <section></section> <section></section> </main>
 * Which get me this:
 * <p></p>
    <main></main> <p></p> <section></section> <section></section>
 * But if i just change the <main> – tag into a <div> – tag it works like it should.
 * <div class=”main”>
    <section></section> <section></section> </div>
 * What is wordpress doing with my main tag?!

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [8 years, 3 months ago](https://wordpress.org/support/topic/closing-tag/#post-10002321)
 * Can you explain the context of what you’re doing?
 *  Thread Starter [clgrmn](https://wordpress.org/support/users/clgrmn/)
 * (@clgrmn)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/closing-tag/#post-10002528)
 * I have a local installation of wordpress with understrap as a parent theme.
 * I just wanted to try something in the wordpress editor, created the structure
   as told above and wanted to inspect it in chrome.
 * But I already figured out what is probably causing the problem. I had following
   function in my functions.php to remove empty <p> – tags.
 *     ```
       add_filter('the_content', 'remove_empty_p', 20, 1);
       function remove_empty_p($content){
          $content = force_balance_tags($content);
          return preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content);
       }
       ```
   
 * After removing this function the main tag is closed as it should be. (after the
   sections)

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

The topic ‘Closing – tag’ is closed to new replies.

## Tags

 * [editor](https://wordpress.org/support/topic-tag/editor/)
 * [paragraph](https://wordpress.org/support/topic-tag/paragraph/)
 * [tags](https://wordpress.org/support/topic-tag/tags/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [clgrmn](https://wordpress.org/support/users/clgrmn/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/closing-tag/#post-10002528)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
