If you frequently find yourself with dozens of forgotten open Safari tabs on your iPhone or iPad, then it can be annoying to sort through them or manually close them later. Luckily, Safari can automatically close tabs after a certain period of time. Here's how to set it up.

First, open Settings. Scroll down until you see "Safari" and tap it.

Tap Safari Settings on iPhone

In Safari settings, swipe down until you see the "Tabs" section, then tap "Close Tabs."

Tap Close Tabs in Safari Settings on iPhone

One the "Close Tabs" screen, you have the option to set the lifespan of an open Safari browser tab. When set, Safari will close tabs that have not been viewed within the period of time you set, and the options are "Manually," "After One Day," "After One Week," or "After One Month." This setting applies to Private tabs as well.

Pick the option that suits you best and tap on it.

Select Tab Lifespan Option in Safari Settings on iPhone

After that, leave Settings. It's handy to know that even after Safari automatically closes your older tabs, you can still find them in the hidden "Open Recently Closed Tabs" menu in Safari for iPhone and iPad. You can access it by holding down the "+" (plus) button on the tab management screen in Safari.

As a potential downside, Safari (as of iOS and iPadOS 13) will also group recently closed Private Browsing tabs in the same "Recently Closed Tabs" area if they are closed automatically. If you want to fully conceal recent browsing activity, it may be best to manually close Private tabs yourself.

Related: How to Reopen Closed Tabs on an iPhone or iPad