WordPress 5.6.1 Introduces Bug Into Post and Page Windows

WordPress 5.6.1 Introduces Bug Into Post and Page Windows

WordPress 5.6.1, which has been auto-updated by many sites, has introduced a bug that makes it difficult to save posts. A temporary patch has been created to resolve the problem but it is not an official update to resolve the issue.

Changes you have made cannot be saved

A bug introduced in the latest version of WordPress, version 5.6.1 causes alerts to pop up when trying to navigate, even if the post is not saved or not.

The bug was reported in a WordPress help page:

Leave the “I’m getting pop ups” site? Changes you make cannot be saved. All the time, if I change a page or not, and if I save (publish or update) the page or not.

This started after a 5.6.1 upgrade this morning. I have 2 sites, with 2 different themes, both with Classic Editor 1.6 and it behaves the same on both.

It does this in Chrome, it does not in Firefox. “


Continue reading below

The fact is that this does not happen in Firefox because according to Mozilla documentation, Firefox handles some aspects of the unload event differently than Chrome, which Chrome lacks some features.

However this is not a Chrome issue. I’m just pointing out why the bug might appear in Chrome but not in Firefox.

Unload event bug in wordpress editing window?

This notice is called an “unload event”, which triggers an alert when a publisher tries to navigate away from the window, usually when something is undone.

The exact warning message triggered is:

“Leave the site? Changes you make cannot be saved.”

The bug reveals itself in both the post and the page. But some publishers have reported that the bug only exists when editing page content and works fine when editing post content.


Continue reading below

According to several reports, bugs can be triggered by editing related plugins such as Tiny MCE and Advanced Custom Fields. Turning off those plugins stops the unload message from spawning.

A publisher told the private Advanced WordPress Facebook group that turning off the Advanced Custom Fields plugin turned off warnings from spawning.

But the problem is not with the plugins themselves. The problem appears to be within the WordPress core itself which is causing the problem to appear in various editing related windows.

A publisher reported relief by turning on the Gutenberg editing environment:

“Do you want to leave this site? Changes you make cannot be saved” 5.6 WARNING ON LEAVING UPDATE PAGE (BUT NOT POSTED) AFTER UPDATED WHEN USING CLASSIC EDITOR OF EDITOR. … When Gutenberg is switched back on, he is gone. “

Another publisher noted that WordPress triggers editing-related plugin bugs:

“Update: It seems that the user has to wait for TinyMCE to fully load before making changes, otherwise the script does not notice his change.

A good visual hint is the toolbar’s dropdown, which expands once the editor has started correctly. “

A user uploaded a video of the walkthrough showing how the bug is spread. In the video the publisher chooses a document to edit and enters the editing window.

The publisher presses the update button to save the next page. They click on a link to navigate away from the next edit window.

But this act causes the unload warning message to spread.


Continue reading below

Below is an animated jiff of the movie that was uploaded showing the bug’s location:

WordPress screenshot animation 5.6.1 editing window bug

Temporary solution posted

A patch has been posted to WordPress, but is not an official fix.


Continue reading below

This version of the patch is fully functional. This is the code that should be inserted into the function.php file.

There is another patch that was shared that addresses an additional issue but has not been fully tested.

WordPress 5.6.1 “Bug Not Saved” Bug

If the problem is disrupting your workflow, there are steps that can be taken. A recommended step might be to wait to ensure that all plugins related to editing are fully loaded. Other actions include disabling editing related plugins or turning on Gutenberg.

There is a patch that can be applied to the function. FP and may finally await an official patch.

Movie showing how WordPress 5.6.1 bug has been triggered


WordPress support page discussion
Changes you have made cannot be saved


Continue reading below

Official WordPress Bug Report Page
“Leave the site? Changes you make after the WP 5.6.1 update cannot be saved on the Custom Taxonomy page”