Pasting Code into the Snippet Editor

Code copied from a chat window, a website, or a file usually arrives wrapped in the tags of its language: a markdown code fence, an opening <?php tag, a <style> or <script> block. Snippets don’t need those wrappers — and since version 4, pasting one strips it away automatically.

What gets stripped

  • Markdown code fences (```)
  • Opening <?php tags
  • <style> and <script> tags

The wrapper is removed the moment you paste, and a notice tells you exactly what was removed. What’s left in the editor is precisely what will be stored — no false syntax errors for markup the plugin was going to strip anyway.

Why this matters

An opening <?php tag inside a snippet is the most common cause of a fatal error in a pasted snippet: the snippet body is executed as PHP, so the tag is a syntax error waiting to happen. Stripping it up front means the snippet you review is the snippet that runs.

Available in Code Snippets 4.0 or later, in both the free and Pro versions.