Developer reviewing WordPress revision diff limits on a monitor with highlighted changes in a long document. Developer reviewing WordPress revision diff limits on a monitor with highlighted changes in a long document.

WordPress Revision Diff Limits Set Three Caps for 7.3

WordPress 7.3 will limit the work revision comparisons do on very large changes. The new defaults keep diffs readable while skipping some detailed highlighting when a comparison exceeds a threshold.
Some links in this article are affiliate links. If you buy through them we may earn a commission, at no extra cost to you. Our conclusions are never for sale. How we make money

A one-line 200 KB table took 48 seconds to compare in WordPress, and a PO file with every line changed crashed the page. A Core development note published November 25 says WordPress 7.3 will add three WordPress revision diff limits to avoid that kind of costly comparison. Here’s what each default changes and what developers can configure.

In brief: WordPress 7.3 adds limits for long changed lines, large changed blocks, and the number of old-by-new line pairs compared. Above a limit, the diff still shows every line, but it may drop word-level highlighting or list removed lines before added lines instead of pairing them side by side. Developers can raise the limits, at a cost in time and memory.

WordPress revision diff limits in 7.3

The new behavior is described in the WordPress Core dev note on revision diff limits. It says the changes have landed in trunk and are set to ship in WordPress 7.3.

The key distinction is between showing the changes and analyzing them in detail. When a comparison crosses a threshold, WordPress still displays every line. It can skip word-level highlighting, or stop arranging old and new lines into side-by-side pairs. The goal is to avoid letting expensive detail work hold up a revision comparison.

ArgumentDefaultWhat happens past the limit
max_word_diff_line_length10,000 bytesThe changed line appears without word-level highlighting.
max_changed_lines5,000The diff shows removed lines, followed by added lines.
max_changed_line_pairs250,000The diff shows removed lines, followed by added lines. The note describes this as about 500 lines on each side.

Why WordPress is changing large revision diffs

Revision comparisons can become expensive when a post contains unusually long lines or a large number of changes. The Core note gives two examples: a one-line table of 200 KB took 48 seconds, while a PO file with every line changed crashed the page. Those examples put a concrete boundary around the problem: the diff can spend a long time calculating how changes correspond, even when the page has only one changed line.

In WordPress 7.3, a comparison that exceeds a limit will use a simpler presentation for the affected part rather than attempt the same level of highlighting or pairing. That means less visual detail in those cases, but the note says the lines themselves remain visible. The developers report that the cited problem cases render in a fraction of a second with the limits in place.

That trade-off is sensible for extreme comparisons. Word-level highlighting helps explain small edits, but it is less useful if generating it makes the revision page wait or fail. The defaults give WordPress a defined point at which it stops doing that extra work.

How developers can adjust the limits

Developers can pass custom values to wp_text_diff(). The dev note shows an example that raises max_changed_line_pairs to 1,000,000. For the revisions screen, it shows the revision_text_diff_options filter and an example that raises max_word_diff_line_length to 50,000.

Those are configuration options, not free performance gains. The note warns that higher limits cost time and memory. As an example, 1,000 changed lines on each side took about eight seconds and 131 MB for a single changed block in the cited test. That is a useful warning for anyone considering larger values: measure the real workload before increasing a cap.

The note does not say developers need to change these settings. For most sites, the stated defaults are the starting point; custom values are relevant when a project has a specific reason to show more detailed comparisons and can accept the extra cost.

What to check before WordPress 7.3

This change is scheduled for WordPress 7.3, not described as an immediate change to current stable releases. Developers who maintain revision-heavy workflows can review their use of wp_text_diff() and the revisions screen filter, then test unusually large content against the defaults when 7.3 becomes available for testing.

For a site that does not customize diff behavior, the practical takeaway is straightforward: very large comparisons may look less detailed, while the changed lines remain available. For a plugin or workflow that relies on word-level highlighting at large sizes, check the new limits and test before raising them.

Frequently asked questions

Which WordPress version adds the new revision diff limits?

The Core dev note says the changes have landed in trunk and will ship in WordPress 7.3. It does not identify them as a change to an existing stable release.

Does a revision diff hide lines when it reaches a limit?

No. The note says the diff still shows every line. Depending on which limit is exceeded, WordPress may omit word-level highlighting or show removed lines followed by added lines.

Can developers raise the defaults?

Yes. Developers can pass options to wp_text_diff() or use the revision_text_diff_options filter on the revisions screen. Higher limits can take more time and memory, so test any change against the site’s actual content.

Next step: if your project handles very large revision comparisons, review the new arguments and test the 7.3 behavior before changing any defaults.

WP Gazette may earn a commission through this recommendation. To check the behavior on your publication, copy a representative long revision to a private test site. An existing Cloudways staging environment can serve that purpose if it runs the WordPress build you intend to evaluate. Compare the displayed changes with the original text before adjusting a limit.

Leave a Reply

Your email address will not be published. Required fields are marked *