PluginSift
PluginsThemesCompare
Directory
  • Plugins
  • Themes
  • Compare Plugins
Plugin Comparisons
  • SEO
  • Security
  • Ecommerce
  • Page Builders
  • Caching
  • Backup
  • Forms
  • Analytics
Resources
  • About
  • Contact
  • llms.txt

© 2026 PluginSift. Data sourced from WordPress.org. · [email protected]

  1. Home
  2. Plugins
  3. Code
  4. Preserve Code Formatting
Preserve Code Formatting icon

Preserve Code Formatting

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

By Scott Reilly·Code·Free
4.7(3 reviews)
·400 active installs·Updated 7 months ago
DownloadVisit HomepageCompare

As of April 2026, Preserve Code Formatting is a WordPress code plugin with 400 active installations and a 4.7/5 rating from 3 reviews. It has been downloaded 49K+ times in total. Requires WordPress 5.5+ and PHP false+. Available on WordPress.org since 2005. Top alternative: WPCode – Insert Headers and Footers +….

4.7/53 reviews
400active installs
49K+total downloads
21 yearssince 2005

Overview

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

NOTE: This plugin does NOT handle posts containing blocks. For such posts, use the built-in code or preformatted blocks to format your code for display. However, this plugin would still be needed if you have text-based posts from before using the blocks-based editor.

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.

Notes:

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

  • Prevent WordPress…
Read full description on WordPress.org

Screenshots

Ratings & Reviews

4.73 reviews
5 ★
2
4 ★
1
3 ★
0
2 ★
0
1 ★
0

Compatibility

WordPress5.5+ requiredTested up to 6.8.5
PHPfalse+ required

Top Alternatives to Preserve Code Formatting

WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager icon
WPCode – Insert Headers and Footers +…
4.93.0M+ installsUpdated 2 weeks ago
ViewCompare
Code Snippets icon
Code Snippets
4.71.0M+ installsUpdated 1 month ago
ViewCompare
Simple Custom CSS Plugin icon
Simple Custom CSS Plugin
4.7100K+ installsUpdated 1 year ago
ViewCompare
Head & Footer Code icon
Head & Footer Code
5100K+ installsUpdated 3 days ago
ViewCompare
Shortcoder — Create Shortcodes for Anything icon
Shortcoder — Create Shortcodes for…
4.9100K+ installsUpdated 1 month ago
ViewCompare
View all code plugins →

Frequently Asked Questions

Changelog

5.0 (2025-08-10)

Highlights:

This major release significantly improves security, performance, and compatibility. The plugin framework updates to version 070 for enhanced security and features. Block editor content is now properly excluded (the plugin was designed for text view), and compatibility extends through WordPress 6.8+ while dropping support for versions older than 5.5. Additional improvements include better error handling, enhanced documentation, and the addition of CSS classes for styling processed code blocks.

Details:

  • Security and hardening:
    • Hardening: Prevent regex pattern injection vulnerability
    • Hardening: Prevent object injection vulnerability. Props Patchstack.
    • Hardening: Prevent bypassing preprocessor by removing any explicit pseudo-tags from content
    • Hardening: Prevent processing of excessively large content

    …and 29 more changes

View full changelog on WordPress.org

Contributors

Scott ReillyScott Reilly
Plugin Info
Version
5.0
Last Updated
Aug 15, 2025
WP Requires
5.5+
Tested Up To
6.8.5
PHP Requires
false+
Active Installs
400
Downloads
49K+
Added
Apr 14, 2005
Business
Free

Tags

codepostescapecontentformatting

Developer

S
Scott Reilly
63 plugins0.1M+ total installs
View all plugins →

Quick Compare

Preserve Code Formatting vs WPCode – Insert Headers and Footers +…→Preserve Code Formatting vs Code Snippets→Preserve Code Formatting vs Simple Custom CSS Plugin→

Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.