Preserve Code Formatting
by Scott Reilly 4.7 (3 reviews)

Preserve Code Formatting

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

Tested up to WP 6.8 (Current: 6.9)
v5.0 Current Version v5.0
Updated 5 months ago Last Update on 15 Aug, 2025
Synced 10 hours ago Last Synced on
Rank
#9,347
-23 this week
Active Installs
500+
-7.6%
KW Avg Position
N/A
No change
Downloads
48.7K
+4 today
Support Resolved
0%
No change
Rating
94%
Review 4.7 out of 5
4.7 (3 reviews)

Next Milestone 600

Total Progress 33%
500+ 600+
428
Ranks to Climb
-
Growth Needed
8,000,000
Active Installs
Pro

Unlock Exact Install Count

See the precise estimated active installs for this plugin, calculated from real-time ranking data.

  • Exact install estimates within tiers
  • Track install growth over time
  • Milestone progress predictions
Upgrade to Pro
Need 67 more installs to reach 600+

Rank Changes

9,317 9,332 9,348 9,364 9,379 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
9,298 9,319 9,340 9,361 9,382 05-01-2026 06-01-2026 07-01-2026 08-01-2026 09-01-2026 10-01-2026 11-01-2026 12-01-2026 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
9,298 9,319 9,340 9,361 9,382 21-12-2025 22-12-2025 23-12-2025 24-12-2025 25-12-2025 26-12-2025 27-12-2025 28-12-2025 29-12-2025 30-12-2025 31-12-2025 01-01-2026 02-01-2026 03-01-2026 04-01-2026 05-01-2026 06-01-2026 07-01-2026 08-01-2026 09-01-2026 10-01-2026 11-01-2026 12-01-2026 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
9,298 9,319 9,340 9,361 9,382 22-10-2025 23-10-2025 24-10-2025 25-10-2025 26-10-2025 27-10-2025 28-10-2025 29-10-2025 30-10-2025 31-10-2025 01-11-2025 02-11-2025 03-11-2025 04-11-2025 05-11-2025 06-11-2025 07-11-2025 08-11-2025 09-11-2025 10-11-2025 11-11-2025 12-11-2025 13-11-2025 14-11-2025 15-11-2025 16-11-2025 17-11-2025 18-11-2025 19-11-2025 20-11-2025 21-11-2025 22-11-2025 23-11-2025 24-11-2025 25-11-2025 26-11-2025 27-11-2025 28-11-2025 29-11-2025 30-11-2025 01-12-2025 02-12-2025 03-12-2025 04-12-2025 05-12-2025 06-12-2025 07-12-2025 08-12-2025 09-12-2025 10-12-2025 11-12-2025 12-12-2025 13-12-2025 14-12-2025 15-12-2025 16-12-2025 17-12-2025 18-12-2025 19-12-2025 20-12-2025 21-12-2025 22-12-2025 23-12-2025 24-12-2025 25-12-2025 26-12-2025 27-12-2025 28-12-2025 29-12-2025 30-12-2025 31-12-2025 01-01-2026 02-01-2026 03-01-2026 04-01-2026 05-01-2026 06-01-2026 07-01-2026 08-01-2026 09-01-2026 10-01-2026 11-01-2026 12-01-2026 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
Current #9,347
Change
Best #

Upgrade to Pro

Unlock 30-day and 90-day rank history charts with a Pro subscription.

Upgrade Now

Active Installs Growth

Active Installs 0,000,000+
Growth +0.0%
Peak 0,000,000

Downloads Growth

0 10 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
0 10 05-01-2026 06-01-2026 07-01-2026 08-01-2026 09-01-2026 10-01-2026 11-01-2026 12-01-2026 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
0 10 21-12-2025 22-12-2025 23-12-2025 24-12-2025 25-12-2025 26-12-2025 27-12-2025 28-12-2025 29-12-2025 30-12-2025 31-12-2025 01-01-2026 02-01-2026 03-01-2026 04-01-2026 05-01-2026 06-01-2026 07-01-2026 08-01-2026 09-01-2026 10-01-2026 11-01-2026 12-01-2026 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
0 10 20 22-10-2025 25-10-2025 28-10-2025 31-10-2025 03-11-2025 06-11-2025 09-11-2025 12-11-2025 15-11-2025 18-11-2025 21-11-2025 24-11-2025 27-11-2025 30-11-2025 03-12-2025 06-12-2025 09-12-2025 12-12-2025 15-12-2025 18-12-2025 21-12-2025 24-12-2025 27-12-2025 30-12-2025 02-01-2026 05-01-2026 08-01-2026 11-01-2026 14-01-2026 17-01-2026 20-01-2026
0 50 100 150 200 20-01-2025 01-02-2025 13-02-2025 25-02-2025 09-03-2025 21-03-2025 02-04-2025 14-04-2025 26-04-2025 08-05-2025 20-05-2025 01-06-2025 13-06-2025 25-06-2025 07-07-2025 19-07-2025 31-07-2025 12-08-2025 24-08-2025 05-09-2025 17-09-2025 29-09-2025 11-10-2025 23-10-2025 04-11-2025 16-11-2025 28-11-2025 10-12-2025 22-12-2025 03-01-2026 15-01-2026 20-01-2026
Downloads
Growth
Peak

Upgrade to Pro

Unlock 30-day, 90-day, and yearly download history charts with a Pro subscription.

Upgrade Now

Reviews & Ratings

4.7
3 reviews
Overall 94%
5
2 (67%)
4
1 (33%)
3
0 (0%)
2
0 (0%)
1
0 (0%)

Tracked Keywords

Showing 0 of 0
Keyword Position Change Type Updated
No keyword data available yet.

Unlock Keyword Analytics

Track keyword rankings, search positions, and discover new ranking opportunities with a Pro subscription.

  • Full keyword position tracking
  • Historical ranking data
  • Competitor keyword analysis
Upgrade to Pro

Track This Plugin

Get detailed analytics, keyword tracking, and position alerts delivered to your inbox.

Start Tracking Free

Plugin Details

Version
5.0
Last Updated
Aug 15, 2025
Requires WP
5.5+
Tested Up To
6.8
PHP Version
N/A
Author
Scott Reilly

Support & Rating

Rating
★ ★ ★ ★ ★ 4.7
Reviews
3
Support Threads
0
Resolved
0%

Keywords

Upgrade to Pro

Unlock keyword rankings, search positions, and detailed analytics with a Pro subscription.

Upgrade Now

Frequently Asked Questions

Common questions about Preserve Code Formatting

Are you using the visual editor? The visual editor has a tendency to screw up some of your intent, especially when you are attempting to include raw code. This plugin does not make any claims about working when you create posts with the visual editor enabled. How to tell if you're using the visual editor: you're using what is now referred to as the Classic Editor (the editing experience in WordPress that pre-dates the block editor since WordPress 5.0). Above the post content field and to the right, there is a tab labeled "Visual" and another labeled "Text". If you're writing code, you want to use "Text" for such posts and not switch back to "Visual".
Yes, shortcodes within code tags (or any tag processed by this plugin) will be output as pure text and not be processed as shortcodes by WordPress.
Yes, in the sense that it doesn't do anything at all. The code and preformatted blocks in the block editor should preserve code formatting without the need for this plugin. In short, the plugin will completely skip processing posts containing blocks. Use the code or preformatted blocks to format and display your code.
Only if you have older posts written in the text editor from before you began using the block editor. If so, then you would still want this plugin to be enabled so that those older posts have their code formatting preserved. This plugin being active will not interfere with posts created with blocks, all of which will be ignored by the plugin.
Asides from its intentional incompatibility with the block editor or classic visual editor, the main known issue with the plugin is its inability to properly recognize (and thus preserve) nested tags that match the tag being preserved. So within, for example, a tag, the first encountered will be treated as its closing tag even if technically that closing tag belongs to a nested 'code' tag, e.g. ``This examplewith nested code tags</code> will be rendered as if that first/inner closing tag belonged to the first/outer 'code' tag. It was a choice between either supporting the above scenario (which seems pretty rare overall) or supporting having multiple adjacent preserved tags in a post (which is much more common). A more robust solution is being pursued.
Yes. The tests are not packaged in the release .zip file or included in plugins.svn.wordpress.org, but can be found in the plugin's GitHub repository. The tests are expecting to be run with PHPUnit 9 and you'll likely experience errors if running them under another version.

Sign In / Register

You need to sign in or register to use this feature.