You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a confirmation modal when clearing the customizations on a template #39124
The impact on clearing a customization on a template or template part can be huge, especially when you put a lot work in building your templates with the FSE.
However, all the work can be deleted with just one or two thoughtless clicks on the menu:
What is your proposed solution?
Add a modal where the user has to confirm that all their work will be deleted. Maybe some additional info text to make clear what impact the clearing exactly has.
changed the title [-]Add a confirm modal when clearing the customizations on a templae[/-][+]Add a confirmation modal when clearing the customizations on a template[/+]on Feb 28, 2022
Worth noting that when you revert whilst editing the document there is an undo affordance:
revert.mp4
We used the undo pattern here for a couple of reasons:
It aligns with other flows in WP like trashing posts
It essentially allows you to "preview" the revert directly on the canvas before fully committing
Obviously the second point doesn't apply on the template list view, and the first point holds less water generally since we removed the ability to retrieve templates from the trash.
All that to say: I think it's probably okay to install the confirmation dialog on template list, but we should acknowledge that the revert flow would then differ based on the view. Is it risky to make a high impact action feel unpredictable?
If we wanted to make reverting consistent, another option might be to make the button itself feel more like a "danger zone" (IE make the link red, to match Trash links), and add the undo action to the Snackbar on list view.
I have created a new issue for the missing confirmation when deleting a template.
I think most of the user do not distinguish between "clear" and "delete". They will lose all their work, no matter what they click, so a similar/same implementation should be used here for both.
Making the "Clear customisation" buttons red, as for "Delete", is definitely an option.
@jameskoster re while editing: I think a confirmation step should also be included while editing, not only for consistency but also for good UX.
Even better would it be, if the Undo affordance would be also implemented in the Template list.
Another random thought: If a modal is implemented, the "Export Theme" function could be linked, so that the user can download a snapshot of the theme before clearing the customisations/ deleting a template.
Example wording, this must surely be refined…
Are you sure you want to clear all customisations?
This action will remove any changes you have made and restore the original settings of the current theme. You can copy all blocks or download the complete theme with all templates and styles beforehand."
Are you sure you want to delete this template?
Deleting this template will remove this template. This cannot be undone. You can copy all blocks or download the complete theme with all templates and styles beforehand."
Activity
[-]Add a confirm modal when clearing the customizations on a templae[/-][+]Add a confirmation modal when clearing the customizations on a template[/+]ntsekouras commentedon Feb 28, 2022
I agree that the impact might be big and it could be good to have an extra confirmation step.. --cc @jameskoster @jasmussen @kjellr
jasmussen commentedon Mar 1, 2022
Keeping #25071 in mind, it seems okay to add a confirmation dialog. I'd keep it simple, though. Maybe use the new ConfirmDialog from #34153?
jameskoster commentedon Mar 2, 2022
Worth noting that when you revert whilst editing the document there is an undo affordance:
revert.mp4
We used the undo pattern here for a couple of reasons:
Obviously the second point doesn't apply on the template list view, and the first point holds less water generally since we removed the ability to retrieve templates from the trash.
All that to say: I think it's probably okay to install the confirmation dialog on template list, but we should acknowledge that the revert flow would then differ based on the view. Is it risky to make a high impact action feel unpredictable?
If we wanted to make reverting consistent, another option might be to make the button itself feel more like a "danger zone" (IE make the link red, to match Trash links), and add the undo action to the Snackbar on list view.
afercia commentedon Jul 19, 2022
Worth mentioning that also when deleting a template (e.g. a custom template) there's no confirmation step. Is there a specific issue for that already?
hanneslsm commentedon Jan 17, 2023
I have created a new issue for the missing confirmation when deleting a template.
I think most of the user do not distinguish between "clear" and "delete". They will lose all their work, no matter what they click, so a similar/same implementation should be used here for both.
Making the "Clear customisation" buttons red, as for "Delete", is definitely an option.
@jameskoster re while editing: I think a confirmation step should also be included while editing, not only for consistency but also for good UX.
Even better would it be, if the Undo affordance would be also implemented in the Template list.
hanneslsm commentedon Jan 17, 2023
Another random thought: If a modal is implemented, the "Export Theme" function could be linked, so that the user can download a snapshot of the theme before clearing the customisations/ deleting a template.
Example wording, this must surely be refined…
ntsekouras commentedon Aug 26, 2026
Resetting a template shows a confirmation modal for quite some time now (#60119), so this is done. Closing, thanks!