Skip to content
Laskyr

Plugins · preserve-code-formatting · data as of 2026-11-04

Is Preserve Code Formatting safe? Known vulnerabilities and latest version

No known unpatched vulnerabilities in the latest version (5.0)

As of 2026-11-04. 1 issue is on record for older versions; version 5.0 or newer fixes all of them that state a fix.

Latest version
5.0
Last updated
2025-08-15
Active installs
400+
Known issues on record
1
Unpatched in latest
0
Tested up to WP
6.8.12

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

What to do

  1. Update to the latest version (5.0). Anything older than 5.0 has at least one known issue listed below. Dashboard → Updates, or Plugins → “update now”.
  2. If you cannot update right away, deactivate it until you can.
  3. Turn on auto-updates for it: Plugins → “Enable auto-updates” on its row.
  4. If you ran a vulnerable version and something looks off (spam pages, strange admins, redirects), run the free scan.

With WP-CLI: wp plugin get preserve-code-formatting --field=version shows what you run; wp plugin update preserve-code-formatting updates it.

Check your version

Known vulnerabilities

1 on record, newest first. “Affected” is the version range the source gives; “fixed in” is the version the source names, or (marked *) the first wordpress.org release after the last affected version.

high 8.8 CVE-2025-49386 · published 2025-11-06

PHP object injection in Preserve Code Formatting (4.0.1 and older)

Affected
4.0.1 and older
Fixed in
5.0
Access needed (per CVSS)
Needs a low-level account (e.g. subscriber)
Range from
CVE record (the advisory publisher) · score by Patchstack
Details from the advisory

Deserialization of Untrusted Data vulnerability in Scott Reilly Preserve Code Formatting preserve-code-formatting allows Object Injection.This issue affects Preserve Code Formatting: from n/a through <= 4.0.1.

NVD CVE-2025-49386Patchstack advisory

Recent activity

Browse vulnerabilities

Where this data comes from

Badge for your site or docs (states facts with a date, not a verdict):
Preserve Code Formatting vulnerability status badge
<a href="https://laskyr.com/plugins/preserve-code-formatting"><img src="https://laskyr.com/plugins/preserve-code-formatting/badge.svg" alt="Preserve Code Formatting vulnerability status"></a>

← Check another plugin · Free hacked-site scan

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit