Recently, I was documenting the steps to reproduce a certain bug and the bug required the presence of an autosave (along with the “There is an autosave of this post that is more recent than the version below.” message). Rather than wait for an autosave to occur naturally, I wanted to speed things up and manually trigger one.
Manually Trigger the “There is an autosave…” Notification
In order to display the “There is an autosave…” notification, we need to do the following:
- Update the content in the body of the editor
- Trigger the Autosave
- Reload the page
1. Update the Content in the Body of the Editor
Update the content in the body of the editor (I’ll often add an extra period to the end of a sentence).
Do NOT Save or Update the post. The message is only displayed when the autosave has changes not included in the saved version.
2. Trigger the Autosave
Run the following from the browser console.
await wp.data.dispatch('core/editor').autosave();
3. Reload the Page
When you reload the page, you should see the notification.
Leave a Reply