How to auto-delete OTP texts and emails on iPhone and Mac

Find out how to keep your 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

You might receive a one-time code sent to your iPhone via text message or email while logging into apps and websites. Over time, these SMS texts and emails pile up and clutter the inbox.

Once used, these codes become useless and serve no purpose. So, your iPhone, iPad, and Mac can automatically delete such texts and emails after they have been auto-filled on the login/verification screen.

Automatically delete SMS texts and emails with verification codes

These steps work on iOS 18, iPadOS 18, and macOS Sequoia.

  1. Open the Settings app on your iPhone or iPad or System Settings on your Mac.
  2. Go to General > AutoFill & Passwords.
  3. Turn on Delete After Use under the Verification Codes section.
Delete verification code after use on iPhone

If you are on iOS 17, iPadOS 18, or macOS Sonoma, go to Settings/System Settings > Passwords > Password Options and turn on Clean Up Automatically.

Clean Up Verification Codes Automatically on Mac

Note: Even after you turn on the “Delete After Use” 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 going forward, your iPhone will delete all OTP texts or emails automatically.

Automatically Delete Verification Codes After Use on iPhone

What happens next?

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

Let me explain further.

Imagine 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 can be filled automatically or appear above your keyboard, and you can insert it with one tap. Similarly, codes you receive via your email in the Apple Mail app can also be auto-filled. The Delete After Use feature on your device will only delete these SMS texts and emails.

SMS code autofill on iPhone

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 even though they have an OTP. You will have to get rid of these texts and emails manually.

Recover texts and emails that were auto-deleted

Like other messages you delete, 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 Delete After Use or Clean Up Automatically.

Check out next: How to schedule messages on iOS 18 and macOS Sequoia