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.

Quick WP htmlentities



This is a plugin that emulates the PHP htmlentities function so that HTML and other code can automatically be formatted into HTML entities using a shortcode in paragraphs and inline within posts. When using this plugin, you must set a checkbox meta value to enable it in each post.


This plugin addresses a tricky problem, WordPress formats and adds paragraph tags before executing shortcodes. So the following code does not work by default because it also formats the paragarphs and breaks WordPress adds.

add_shortcode('htmlentities', 'htmlentities_func');
function htmlentities_func($atts, $content = null) {     
     return htmlentities($content);     

To make this shortcode work this plugin rearranges the execution order of the “the_content” filter executing shortcodes before formatting. Uncheck the meta value box in the backend if this causes issues.

Standard Block Usage

Lorem ipsum dolor sit amet, consectetur adipiscing elit. 


<span style="color:blue">Using a style.</span>


Donec mauris metus, scelerisque id fermentum id, ornare at metus.

Standard Inline Usage

[quick-wp-htmlentities]<span style="color:blue">Using a style.</span>[/quick-wp-htmlentities]


  • Revisited the plugin after some time to try make it work sensibly.
  • DO NOT upgrade without thought if you are using version 1.1. Some functionality was removed.


  • Fixed problem with ampersands (&) which caused plugin to fail (wpautop already substitutes htmlentitities for ampersands).
  • Now purges line breaks, tabs and carriage returns from output so pre tags and related styles work.


  • Plugin created.

Contributors & Developers

“Quick WP htmlentities” is open source software. The following people have contributed to this plugin.