This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

L//H WPAUTOP Extended


This plugin basically just consists of one function, that extends the functionality of WordPress own wpautop function.

On several occasions a theme developer might feel the need, that a certain HTML Tag should not be wrapped in paragraphs.
This plugin deactivates the standard wpautop function and replaces it with an extended version of that plugin. Upon
activation of this plugin you’ll have access to the ‘lh_wpautop_block_elements’ filter, which gives you the ability to extend,
modify and enhance the array of standard elements, which are per default not wrapped in <p> tags.

With that plugin you could place this function into the theme functions.php, Images and Iframes will no longer be wrapped in paragraphs.

function add_block_elements($block_elements){
        $block_elements[] = "iframe";
        $block_elements[] = "img";

        return $block_elements;
add_filter("wpautop_block_elements", add_block_elements);

This Plugin is brought to you by Luehrsen // Heinrich


  1. Upload the plugin to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. You now have the filter ‘wpautop_block_elements’ available


What is a filter?

You should probably not use this plugin. But for further education I recommend to read the WordPress Codex page on filters.

What is the recommended usage for this plugin?

If I were you, I would adopt this function into my theme for easier shipment. But always consider the risk of overwriting a potential newer, better and updated version of wpautop. If you do adopt this function, be sure to check the original wpautop function upon every WordPress release and keep the function up to date.

Wouldn’t it be awesome to have this function built into WordPress itself?

Yes, indeed. That’s why I opened a ticket, that has this goal.

But Nacin is right by neglecting this change, isn’t he?

By saying “This mangling should not be left to plugins.” he is probably right in terms of standards and regulations. But I’ve seen enough occasions of this functionality being a necessity, that’s why I’m lobbying to implement it into WP Core. But it still is a tricky issue, where you should know, what you’re doing.

Contributors & Developers

“L//H WPAUTOP Extended” is open source software. The following people have contributed to this plugin.




  • Initial release