Around the time of WordPress 3.9, I implemented a custom post type with repeating wysiwyg meta-boxes. (cobbled together and adapted from code found here: http://www.kathyisawesome.com/426/multiple-wordpress-wysiwyg-visual-editors/). It worked perfectly and I was happy.

Fast forward several months, and a site which has been auto-updated to WP 4.1.1 now is doing very strange things on SAVE while using the wysiwyg editor.

What I enter (and then check the html source) is this:

<p>this is the main section bullets</p><ol><li>one</li><li>two</li><li>three</li></ol>

But what Wordpress ends up saving is this:

<p>this is the main section bullets</p><p> </p><ol><ol><li>one</li></ol></ol><p> </p><ol><ol><li>two</li></ol></ol><p> </p><ol><ol><li>three</li></ol></ol><p> </p>

I should note this strange formatting does NOT happen with the built in WP editor at the top of every post, it only happens in the wysiwyg metaboxes that I added in my plugin.

What changed in the intervening versions of WordPress? I know this may be somewhat broad, but if anyone has seen anything similar or can point me in any direction, to any known issues of this sort, I would be very grateful.

  • 1
    please post the relevant code here. No one on the internet follows links that do not lead to funny videos of cats. Mar 10, 2015 at 19:04

1 Answer 1


IT turned out to be less hassle to just recreate my plugin using the latest and greatest code available here:


And it also turned out to have something to do with the filter being applied to the editor. This:

<?php echo esc_html( wp_richedit_pre($mb->get_the_value()) ); ?>

was the problem, replacing it ultimately with this solved it:

<?php echo esc_html(html_entity_decode( $mb->get_the_value() ) ); ?>

Hope this helps someone else out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.