Comparing two revisions of a very large post can hang your browser or crash the page. WordPress 7.3 fixes that.

A revision “diff” is the screen that shows what changed between two saved versions of a post. On huge content, it has been slow. According to the WordPress core team, a single 200 KB line in a table took 48 seconds to compare. A translation file with every line changed crashed the page.

What changes

WordPress 7.3 adds three limits to the diff. When a change goes past a limit, WordPress still shows every changed line. It just does less work to display it.

  • Very long lines: a changed line over 10,000 bytes is shown without word-by-word highlighting.
  • Large changed blocks: a block with more than 5,000 changed lines shows the removed lines first, then the added lines.
  • Big side-by-side comparisons: blocks of roughly 500 lines on each side are shown the same way.

The core team says these cases now render in a fraction of a second.

What you need to do

Nothing. The change shipped to the development version of WordPress and arrives with 7.3.

If you run very large posts, such as long data tables or imported text, you will see plainer diffs for those edits. No content is hidden.

Developers can raise the limits with a filter called revision_text_diff_options. Higher limits cost more time and memory. The core team measured about 8 seconds and 131 MB for one block with 1,000 changed lines on each side. Most sites should leave the defaults alone.


End of article