Affiliate Disclosure
If you buy through our links, we may get a commission. Read our ethics policy.

How to automatically delete two-factor authentication codes in iOS 17

SMS codes in Messages and Mail

Last updated

The Messages and Mail apps on iOS can quickly become cluttered with SMS codes for two-factor authentication, but iOS 17 can automatically delete them. Here's where to find it.

SMS two-factor authentication (SMS 2FA) is a security mechanism that provides protection to online accounts and services. It involves using a user's mobile phone number to verify their identity during the login process.

When users attempt to log in to an account with SMS 2FA enabled, they are prompted to enter their username and password as usual. Along with these credentials, the service sends a unique one-time verification code via SMS to the user's registered mobile number.

The user must then retrieve the code from their SMS messages and enter it into the login interface within a specified time frame. If the entered code matches the one sent by the service, the user is granted access to their account.

This two-step verification process helps ensure that even if an attacker obtains the user's password, they still need physical access to the user's mobile phone to retrieve the verification code. SMS 2FA is widely used by various online platforms, including social media networks, banking services, email providers, and more, to enhance the security of user accounts and protect against unauthorized access.

Having iOS 17 automatically delete these two-factor authentication codes offers various benefits.

  • Cleanliness: Verification codes can clutter your message inbox, making it harder to find important personal messages. Auto-deleting these codes keeps your inbox clean and organized.
  • Efficiency: With auto-deletion, you don't have to manually delete these messages, saving you time and effort.
  • Prevents Confusion: If you receive multiple codes from the same service, it can be confusing to determine which is the most recent or relevant. Auto-deleting old codes can help prevent this confusion.

The auto-deletion feature only removes the codes once they've been used or are no longer valid, so it won't interfere with your ability to use them for verification purposes.

How to automatically delete SMS codes in iOS 17

  1. Open the Settings app on your iPhone.
  2. Navigate to Passwords.
  3. Go to Password Options.
  4. Enable the Clean Up Automatically option.

Besides the Messages app, iOS 17 can automatically delete two-factor authentication codes in Mail. It's a seamless experience once you turn it on, and it's an excellent way to remove clutter from one-time passcodes.