How to have your iPhone, iPad, and Mac automatically delete text messages and emails with verification codes

Find out how to keep your message and email inbox clean by having your iPhone, iPad, and Mac automatically delete used text messages and emails that have login or OTP verification codes.

Automatically delete verification code SMS on iPhone

While logging into apps and websites, you might receive a one-time code sent to your iPhone via text message or email. Over time, these SMS texts and emails pile up and clutter the inbox, as after using these codes once, they become useless and serve no purpose.

iOS 17, iPadOS 17, and macOS Sonoma have added a thoughtful feature that automatically deletes such texts and emails after they have been auto-filled on the login/verification screen.

In this tutorial, we will show you how to enable this, as it’s turned off by default.

Note: Currently, all these operating systems are in the developer beta stage, and you can install them using these tutorials:

Automatically clean up verification SMS texts and email

This feature is available on iPhone, iPad, and Mac. As a result, not only emails with an OTP but even iPhone text messages visible on your iPad and Mac via iCloud Messages should be deleted after use.

On iPhone and iPad

  1. Open the Settings app on iOS 17 or iPadOS 17.
  2. Scroll down and tap Passwords. Use Face ID, Touch ID, or your device passcode to go inside.
  3. Tap Password Options.
  4. Finally, turn on Clean Up Automatically under the Verification Codes heading.
Clean Up SMS and email Verification Codes automatically on iPad

From now on, texts and emails with verification codes will be deleted automatically after the code is inserted with AutoFill (more on this below).

Note: Even after you turn on the “Clean Up Automatically” switch, the first time your iPhone auto-deletes a verification code message, you may see a popup asking, “Automatically Delete Verification Codes After Use?” Tap Delete After Use, and from now on, your iPhone will take care of such texts.

Automatically Delete Verification Codes After Use on iPhone

On Mac

  1. Open System Settings.
  2. Select Passwords from the left sidebar and use Touch ID or Mac’s password to authenticate.
  3. Click Password Options.
  4. Enable Clean Up Automatically.
Clean Up Verification Codes Automatically on Mac

Important: It only deletes auto-filled codes!

Let me explain the basics first.

Autofilling verification codes

Suppose you’re on an app or website’s login page where you need to enter the OTP sent to you via SMS. When that SMS comes, the code automatically appears above your keyboard, and you can insert it with one tap. This isn’t a new feature and has existed for a few years!

SMS code autofill on iPhone

But iOS 17, iPadOS 17, and macOS Sonoma have taken things one step further, and now iPhone, iPad, and Mac can even autofill codes you receive in your email in the Apple Mail app.

Autofill verification codes received in Mail on iPhone

In other words, codes sent via SMS or/and email can now be auto-filled while logging in.

Deleting verification code received in texts and emails

As mentioned earlier, the new Clean Up Automatically feature in iOS 17, iPadOS 17, and macOS Sonoma will only delete those SMS texts and emails whose codes are auto-filled.

However, if an app or website’s format/wording/presentation of their verification code SMS and email is different and your iPhone’s autofill can’t understand and use that, then such texts and emails will not be deleted automatically. You will have to get rid of these texts and emails manually like you have been doing until now.

Recover texts and emails that were auto-deleted

Like other messages you delete, these auto-deleted SMS and emails with verification codes are sent to the Recently Deleted or Trash section of the Messages/Mail apps. You can easily recover them from there.

If someday down the line, you decide to keep all verification code SMS and emails, follow the above steps and turn off the switch next to Clean Up Automatically.

Check out next: