WordPress plugin
Raw HTML Pro
Raw HTML Pro protects selected HTML, JavaScript, and CSS from WordPress formatting that can change the code. It supports a workflow between the Text/HTML and Visual editors: protected code appears as a read-only placeholder in Visual mode, then returns when you switch back to HTML or when the post is displayed to readers.
Raw HTML Pro protects selected HTML, JavaScript, and CSS from WordPress formatting that can change the code. It supports a workflow between the Text/HTML and Visual editors: protected code appears as a read-only placeholder in Visual mode, then returns when you switch back to HTML or when the post is displayed to readers.
Protect selected content
Wrap a section in [raw]...[/raw] tags to prevent changes such as turning newlines into paragraphs or replacing straight quotation marks with typographic quotes. Protected content can also be kept from picture smilies and character conversion. A second tag format works the same way, but its content is not visible to users if Raw HTML is deactivated.
Choose formatting filters per post
Checkboxes on the Edit Post screen let you disable selected WordPress filters for an individual post. Options include wptexturize, which makes 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 run them, add shortcodes=1 to the raw tag, as in [raw shortcodes=1]. Raw blocks are removed from automatically generated excerpts by default. To keep them in excerpts, add the RAW_HTML_KEEP_RAW_IN_EXCERPTS definition to wp-config.php.
Editor and permission requirements
Raw HTML does not fully support Gutenberg. Since WordPress 5.0, some features work only with the Classic Editor plugin. For posts with custom code, the documented workflow is to edit in Text/HTML mode; the Pro version offers read-only placeholders when Visual editing is also needed.
Some features require the unfiltered_html capability. In a standard WordPress installation, Editors and Administrators have this capability. In Multisite, it is available by default only to the Super Admin.
Use it in a post or page
Open a post or page in an available editor, wrap content that should be protected in raw tags, choose any per-post filter settings you need, and save. Edit the original protected content in Text/HTML mode; use the Pro placeholders to avoid changing it accidentally in Visual mode.