WordPress plugin
Raw HTML Pro
Raw HTML Pro keeps selected HTML, JavaScript, and CSS from being changed by WordPress formatting. Wrap content in [raw]...[/raw] tags to prevent newlines from becoming paragraphs and straight quotation marks from turning into typographic quotes. Raw blocks also protect content from picture smilies and character conversion.
Protect selected code in WordPress
Raw HTML Pro keeps selected HTML, JavaScript, and CSS from being changed by WordPress formatting. Wrap content in [raw]...[/raw] tags to prevent newlines from becoming paragraphs and straight quotation marks from turning into typographic quotes. Raw blocks also protect content from picture smilies and character conversion.
In Visual mode, the Pro version shows protected code as a read-only placeholder. The original code returns when you switch to Text/HTML mode and remains in place when the post is displayed to readers. An alternate raw-tag format works the same way and is not visible to users if Raw HTML is deactivated.
Choose per-post formatting filters
Raw HTML adds checkboxes to the Edit Post screen for disabling selected WordPress filters on a post-by-post basis. Options include wptexturize, which creates smart quotes and other typographic characters; automatic paragraph creation; image smilies; and convert_chars, which converts ampersands to HTML entities and adjusts some Unicode characters.
Shortcodes and excerpts
Shortcodes inside raw blocks appear as plain text by default. To execute them, add the shortcodes=1 attribute to the raw tag, as in [raw shortcodes=1]. Automatically generated excerpts omit raw blocks by default. To keep them in excerpts, add the RAW_HTML_KEEP_RAW_IN_EXCERPTS definition to wp-config.php.
Editor support and permissions
Raw HTML does not fully support Gutenberg. Since WordPress 5.0, some features work only with the Classic Editor add-on. The documented process for posts with custom code uses Text/HTML mode; the Pro version includes read-only placeholders when Visual editing is needed.
Some capabilities require the unfiltered_html capability. On a standard WordPress installation, Editor and Administrator roles have this capability. On Multisite, it is available by default only to the Super Admin.
Using Raw HTML Pro
Add Raw HTML Pro to WordPress and open a post or page in an available editor. Wrap the code to protect in raw tags, choose any per-post filter settings you need, and save the content. When you edit in Visual mode, protected code appears as read-only placeholders.