• Access & Security 95
  • Administration 172
  • Advertisement 92
  • Audio & Video 66
  • Author & Content 99
  • Comments 96
  • Communication 110
  • Communities & Forums 84
  • Development 47
  • E-Commerce 76
  • Email Management 53
  • Events & Calendars 80
  • Language 25
  • Map & Weather 44
  • Migration & Conversion 28
  • Miscellaneous 254
  • Mobile 15
  • Photos 143
  • Plugins 260
  • SEO & Site Speed 118
  • Social 186
  • Theme Enhancement 169

  • Add this plugin to a List

    You need to be logged in to add this plugin to your list.

    Preserve Code Formatting

    Add to List

    This plugin preserves formatting of code for display by preventing its modification by WordPress and other plugins while also retaining whitespace.

    NOTE: Use of the visual text editor will pose problems as it can mangle your intent in terms of code tags. I strongly suggest you not use the visual editor in conjunction with this plugin as I have taken no effort to make the two compatible.


    Basically, you can just paste code into code, pre, and/or other tags you additionally specify and this plugin will:

    • Prevent WordPress from HTML-encoding text (i.e. single- and double-quotes will not become curly; “–” and “—” will not become en dash and em dash, respectively; “…” will not become a horizontal ellipsis, etc)
    • Prevent most other plugins from modifying preserved code
    • Prevent shortcodes from being processed
    • Optionally preserve whitespace (in a variety of methods)
    • Optionally preserve code added in comments

    Keep these things in mind:

    • ALL embedded HTML tags and HTML entities will be rendered as text to browsers, appearing exactly as you wrote them (including any br tags).
    • By default this plugin filters ‘the_content’ (post content), ‘the_excerpt’ (post excerpt), and ‘get_comment_text (comment content)’.


    A post containing this within code tags:

            INSERT INTO $tablepostmeta
            VALUES ('$post_id','link','$extended')

    Would, with this plugin enabled, look in a browser pretty much how it does above, instead of like:

    INSERT INTO $tablepostmeta
    VALUES ('$post_id','link','$extended')

    Links: Plugin Homepage | Plugin Directory Page | Author Homepage

    Rate This Plugin

    Please Login to Rate this Plugin!




    0 Votes
    Not Rated Yet Stats

    Last Updated523 Days ago
    Published12 years ago

    Report Wrong Category!