Title: editor filtering code
Last modified: August 18, 2016

---

# editor filtering code

 *  [Tdude](https://wordpress.org/support/users/tdude/)
 * (@tdude)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/editor-filtering-code/)
 * Hi!
    In all of my WP installs, 2 of them the latest 2.12, the wysiwyg editor 
   messes up the div tags I insert in code view and changes them to p tags. It just
   adds a paragraph tag and a no breking space in between them. What is this? I’m
   a programmer and all that, but want to use the wysiwyg editor anyway. Is there
   an easy way to get into the regexp filtering of the editor?
 * Here’s what i want to do with the wysiwyg editor on, but in html mode:
 *     ```
       <div class="column">
       first column
       </div>
       <div class="column">
       second column
       </div>
       ```
   
 * It turns into something like this after I save and open it again:
 *     ```
       <p class="column">&nbsp;</p>
       first column
       <p class="column">&nbsp;</p>
       second column
       ```
   
 * As you can see, this gets serious from a layout point of view. It happens if 
   I open a previous post which is correct and validated.
    I’ve tried to dig into
   the TinyMCE files, but couldn’t find what I was looking for (yet) I’ve also tried
   posting questions about this here and there. Any hints anyone? (except “turn 
   the wysiwyg editor off”)

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

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [19 years, 3 months ago](https://wordpress.org/support/topic/editor-filtering-code/#post-534714)
 * > Here’s what i want to do with the wysiwyg editor on, but in html mode:
   >  <div
   > class=”column”> first column </div> <div class=”column”> second column </div
   > >
 * You do realize that this code is invalid markup, right? Div is a block level 
   element which can only contain other block level elements. Straight text is an
   inline element. You could do something like `<div><p>text</p></div>` and that
   would be valid, since P is a block level element which can only contain inline
   elements.
 * I admit that the editor is annoying, but when you feed it bad markup and it tries
   to fix it, it’s probably going to do it badly.
 *  [sauceyman](https://wordpress.org/support/users/sauceyman/)
 * (@sauceyman)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/editor-filtering-code/#post-535103)
 * Otto, I think somewhere along the way you’ve been misled. His code Is valid code.
   A Div tag may contain both block and inline elements.
 * Tdude, the answer to your problem can be found at this post…
 * [http://wordpress.org/support/topic/102696?replies=4](http://wordpress.org/support/topic/102696?replies=4)
 *  Thread Starter [Tdude](https://wordpress.org/support/users/tdude/)
 * (@tdude)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/editor-filtering-code/#post-535131)
 * Never mind. Thanks Sauceyman! Otto too!

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

The topic ‘editor filtering code’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [Tdude](https://wordpress.org/support/users/tdude/)
 * Last activity: [18 years, 10 months ago](https://wordpress.org/support/topic/editor-filtering-code/#post-535131)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
