Undo is better than Confirm

Wednesday, 11 November 2009

Consider a Delete button in an application. Click the button and something gets deleted. But what if you click it by accident? Two approaches are commonly recommended:

  • Confirm: Require the user to confirm the action before doing it
  • Undo: Do the action immediately, but allow the user to undo it

The Confirm strategy offers the worst of both worlds. It slows down people who actually want to delete, and it fails to protect those who don’t. In contrast, the Undo strategy offers minimum impediment to purposeful users while making it easy to avoid losing work.

To be concrete, let’s talk about specific implementations. One Confirm approach is to display a modal alert box saying “Are you sure?” with Delete and Cancel buttons. Another approach simply turns the Delete button into a Confirm button, requiring a second click to carry out the deletion. The Undo approach typically carries out the deletion, but displays an Undo button or link somewhere (perhaps next to the Delete button), which undoes the action when clicked.

Now let’s compare the approaches. There are two cases: either somebody clicked the Delete button on purpose, or else by accident. If the person clicked the Delete button on purpose, the Confirm strategy forces the person to carry out another action to confirm the action. Clearly, this gets in the way. The Undo strategy, on the other hand, simply offers an extra option after the action has occurred. The person can simply ignore this option.

If the person clicked Delete by accident, then the Confirm approach will not delete yet; instead it displays a new button that will immediately carry out the action. But the user has just taken the positive action of clicking a button. His finger is still on the button and he’s in a clicking mood. If a new button appears, there’s every chance he will click it. Warning messages (“Are you sure you want to delete?”) may not help — people often don’t read them.

“I want to save this work.”
Delete *click*
Are you sure blah blah blah? *click*

“Oh no!”

The point here is that since the initial action was a mistake, there’s no point in getting the user to confirm with the same kind of action. If I click a button by accident, don’t show me another button, otherwise I’ll just click that by accident too. The Undo technique does not have this problem. With Undo, once I have made the mistake there’s nothing more I can do to make it worse; but if I realise my mistake then I can easily take action to correct it.

This is a useful application of the old quote “It’s easier to ask forgiveness than permission.” Don’t waste time upfront making sure that the user is on the right path. Maximum usability is achieved by smoothing the path while allowing the user to backtrack if necessary.



You can leave a comment, or trackback from your own site.

  1. Nicely written.

    Once i had also deleted my wordpress post by mistake and i clicked “are you sure?” too accidentally.
    But now wordpress sends the posts or anything into trash and latter we can gain them back.

  2. Yes! WordPress has seen the light. Undo is harder to implement than confirmation, but it’s so much better for users.

  3. great rule!

    i guess only in 2 situations we should still use “confirm”:
    – when the effefect of the action has little visibility or
    – where an undo is impossible.

  4. You can always make the effect of an action visible. For example, when deleting something you can add a notification message saying something like “Item deleted. Undo” where the Undo is a link.

    You’re right, sometimes an undo is impossible. For example, sending an email or formatting a disk. In those cases confirm might be the best option. I would be interested to hear of any alternatives.

Leave a comment