Pure HTML is a WordPress plugin that allows you to add html markup, such as the code to embed Google maps, that is normally stripped out and removed by visual mode in the page/post editor.
It also comes with the ability to save code snippets for use on multiple pages without needing to update all pages when making a change to that particular snippet.
Using pure HTML is simple; either place your html inside the pure HTML shortcode or save your html as a snippet and call it using the ID attribute inside the shortcode tag, e.g. [pureHTML id=1]
When inserting your html directly into the page using the pure html shortcode you will need to change ALL < and >’s to [ and ] respectively. These prevent WordPress removing them when the view is changed to visual mode. These square brackets are then changed back at run time.
At run time ALL square brackets are converted to their < > counter parts so to add in a square bracket that isn’t to be converted you need to ‘escape’ it using a \ so it will be \].
Using saved snippets is simple, on the Pure HTML Snippets page you can see a list of the snippets you have saved. On this screen you can add, modify and remove snippets.
There is no limit to the number of snippets you can save except for the maximum size of your database! To add a new snippet simply enter a name for it in the name field, this name is used to find and identify it easily, this could be a description of the snippet or just a name, however there is a character limit of 100 characters. Next, add your HTML to the text box, this HTML does NOT use the square bracket replacement system that the inline html does. Once saved the snippet will be shown at the top of the page with an ID. It is this ID that you place into the shortcode to use that snippet. For example: [pureHTML id=1] will use the snippet ID 1.
Installation is Quick, just upload the 2 PHP files to a PureHtml folder within wp-content/plugins and then activate the plugin through the admin dashboard, or find the plugin using the WordPress plugin search and click install
Q. What Tags Are Automatically Removed?
Currently all <br /> and <p> (and its closing counterpart) tags are removed from the input code because these are the tags that WordPress automatically add.
Q. How Do I Add Tags Without Them Being Stripped?
If you want to echo a paragraph tag or a line break, or any other tag (strong, em etc) instead of enclosing them in < and > tags, enclose them in [ ] brackets for example [p] instead of <p> The square brackets are converted after the inital tags are stripped and function as normal tags.
Q. How Do I Include a [ or ] In My Output Without It Being Removed
To prevent [ or ] being changed to the < or > (respectively) you will need to ‘escape’ it using a \, so ] will become \] and [ will become \[.
Q. What Happens To The Output If I Delete The Snippet It Uses?
If you delete a snippet that is being used in a page then the output generates a 404 error that displays in its place.