• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WebPhoneTech

How-to Guides for Your iPhone

  • All iPhone guides
  • Safari
  • Chrome & Firefox
    • Chrome
    • Firefox
    • Edge
  • Default apps
  • Security
  • About
You are here: Home / iPhone / How to Clean a Virus Off Your iPhone (iOS 27)

How to Clean a Virus Off Your iPhone (iOS 27)

July 28, 2025 By WebPhoneTech Editorial Team

To clean a suspected virus off an iPhone, use the tools Apple already built in: update to the latest iOS, delete any app you don’t recognize, remove unknown configuration profiles in Settings > General > VPN & Device Management, and clear Safari’s data in Settings > Apps > Safari > Clear History and Website Data. Those four moves fix the large majority of “my iPhone has a virus” problems, which are usually scam pop-ups, adware-style websites, spam calendars or a rogue profile rather than a true self-copying virus.

The steps below are written for iOS 27, the current iPhone software. Where an older version of iOS puts a setting somewhere else, that is called out separately. Erasing the iPhone is covered too, but only as a last resort, because it deletes everything on the phone.

What a “virus” on an iPhone usually turns out to be

A classic computer virus copies itself from file to file. That is very hard to pull off on an iPhone, because each app runs in its own walled-off space (Apple calls this sandboxing) and apps normally come only from the App Store. When people say their iPhone is infected, the cause almost always falls into one of these groups:

  • Scam pop-ups in Safari. A web page shows a warning that your iPhone is infected, often with an Apple logo, a countdown and a button or phone number. Apple says misleading pop-ups and ads that claim your device has a security problem are a common scam tactic. The page itself is the whole problem.
  • Calendar spam. Events or a whole calendar you never added, full of alarming titles and links. These come from an invitation or a subscription you accepted by accident.
  • A configuration profile. A profile is a small file that can change settings, add a VPN, install certificates or let an organization manage the phone. Schools and employers use them legitimately, but a profile installed from a shady website can route your traffic or change settings.
  • A bad app. An app that shows aggressive ads, asks for permissions it doesn’t need, or that you don’t remember installing.
  • A compromised account. Someone has your Apple Account password, or a person you know has access to the phone. That is a different problem from malware, and it is handled with Safety Check and your account settings (covered later).
  • Targeted spyware. Extremely rare, very expensive attacks aimed at specific people such as journalists, activists and officials. Apple sends threat notifications to people it believes were targeted and offers Lockdown Mode as protection.

Battery drain, heat and slowness on their own are weak signs. An old battery, a nearly full storage drive or an app stuck in a loop causes those far more often than malware does.

Before you start

  • Know your passcode and Apple Account password. Removing a profile, changing account settings and erasing all ask for one or the other.
  • Back up if you can. Nothing in the first part of this guide deletes your photos or messages, but a fresh backup protects you if you end up erasing later. Note the date, because later you will want a backup from before the trouble started.
  • Check whether the iPhone belongs to work or school. If your employer or school issued the phone, its profile and management settings are probably legitimate. Ask the IT team before removing anything in VPN & Device Management.
  • Write down the symptom. “Pop-ups in Safari,” “weird events in Calendar” or “an app I didn’t install” points you to the right fix below and makes it easy to tell later whether the problem is gone.

Clean your iPhone in iOS 27

Work through these in order. Each one is quick, none of them erases your personal content, and stopping as soon as the symptom disappears is fine.

1. Get out of the scary page without tapping it

If a web page is telling you the iPhone is infected, don’t tap its buttons, don’t call the number it shows and don’t install anything it offers. Apple warns that some pop-ups have fake close buttons. Instead:

  1. Tap the Tabs button in Safari and close that tab, or tap the address field and type a different site.
  2. If the page keeps reopening, close Safari’s tabs and continue with the Safari cleanup in step 5.

If you already typed a password or payment details into such a page, change that password right away and contact your bank. Apple’s advice on recognizing phishing and other scams covers what to do next.

2. Update iOS

Security fixes arrive through software updates, and an update keeps your data and settings in place.

  1. Open Settings, tap General, then tap Software Update.
  2. The screen shows your current iOS version. If an update is available, tap Download and Install and follow the prompts. Keep the iPhone charging and on Wi-Fi.
  3. Back on the Software Update screen, tap Automatic Updates and turn on Automatically Install so future fixes install overnight while the phone charges.

Apple documents these controls in its guide to updating iOS on iPhone.

3. Delete apps you don’t recognize

Scroll through your Home Screen pages and the App Library (swipe left past the last Home Screen page). Look for apps you don’t remember installing, apps with vague names, and anything you installed around the time the trouble began.

  1. Touch and hold the app icon.
  2. Tap Remove App, then tap Delete App. Choosing Remove from Home Screen only hides it, which doesn’t help here.
  3. Tap Delete to confirm.

Deleting an app removes it and its data from the iPhone, though anything it saved to iCloud stays there. If you change your mind about a legitimate app, you can download it again from the App Store.

Your iPhone also checks installed third-party apps against malware Apple has identified. If an alert says an app contains malware and can’t be opened, tap Delete App right in the alert. Apple lets you re-enable such an app in Settings, but it warns that doing so could harm the device or your privacy, so it’s best to leave it deleted. Apple explains the alert in its article on third-party apps flagged for malware.

4. Remove unknown configuration profiles

  1. Open Settings > General > VPN & Device Management.
  2. If the screen shows no profiles, none are installed and you can skip to the next step.
  3. If you see a profile you didn’t knowingly install and that doesn’t come from your employer or school, tap it to see who made it and what it contains.
Recreated illustrative VPN and Device Management profile row named Sample Profile highlighted
Installed configuration profiles appear in VPN & Device Management. This recreated row uses the fictional name Sample Profile to identify the item to inspect; it is not an installed profile or the complete settings page.
  1. Tap Remove Profile, enter your passcode, and confirm.
  2. Restart the iPhone afterward.

Removing a profile also deletes the settings, apps and data it added. For example, a VPN that the profile set up stops working. Apple’s notes on installing or removing configuration profiles explain what a profile can contain.

5. Clean up Safari

  1. Open Settings, tap Apps, then tap Safari.
  2. Scroll down and tap Clear History and Website Data.
Safari settings on iPhone showing Clear History and Website Data and the Block Pop-ups switch
Choose Clear History and Website Data in Safari settings. This recreation follows Apple’s published current section; the separate pop-up and website-warning controls are outside the excerpt.
  1. Choose the timeframe (choose all history if the pop-ups have been around for a while), then tap Clear History.
  2. Back on the Safari settings screen, make sure Block Pop-ups and Fraudulent Website Warning are both turned on.
  3. Tap Extensions and turn off or delete any Safari extension you don’t recognize.

Clearing history signs you out of websites but doesn’t change your AutoFill information. If you would rather keep your browsing history, go to Safari > Advanced > Website Data and tap Remove All Website Data instead, which clears cookies and cached data only. Apple describes both options in deleting Safari history, cache and cookies, and you can read more about what each choice removes in this walkthrough on clearing the Safari cache on iPhone.

If you use another browser, such as Chrome or Firefox, clear its browsing data from inside that app as well.

6. Remove spam calendar events and subscriptions

  1. Open the Calendar app and tap the spam event. Don’t tap any link inside it.
  2. Tap Delete Event, then confirm. If the event came from someone you don’t know, tap Report Junk, then Delete and Report Junk.
  3. If a whole calendar is spam, tap the Calendars button, tap the info button next to that calendar, then tap Delete Calendar or Unsubscribe and confirm.
Recreated Sample Spam Calendar command detail with Unsubscribe highlighted
Open the calendar’s information, then choose Unsubscribe or Delete Calendar as appropriate. This recreation isolates the documented Unsubscribe command for fictional Sample Spam Calendar; no subscription was opened or removed.

These steps come from Apple’s article on deleting calendars and removing events on iPhone, which covers iOS 26 or later.

7. Restart the iPhone

On an iPhone with Face ID, press and hold the side button and either volume button until the sliders appear, then drag the Power Off slider. On iPhone SE, hold the side button alone. You can also go to Settings > General > Shut Down. Wait a few seconds, then press and hold the side button until the Apple logo appears. A restart won’t remove a bad app or profile by itself, but it closes anything left running from the earlier steps.

Which step fixes which symptom

  • “Your iPhone is infected” pages or constant redirects in Safari: steps 1 and 5.
  • Strange events or a calendar full of links: step 6.
  • Unknown VPN icon, settings you can’t change, or a “managed” notice: step 4.
  • An app you didn’t install, or ads popping up outside the browser: step 3.
  • Password changed, unknown devices on your account, or messages you didn’t send: the account section below.
  • An Apple Threat Notification: the Lockdown Mode section below.

When the problem is a person, not an app

If someone may know your passcode, has had your phone in hand, or is getting into your Apple Account, malware cleanup alone won’t lock them out. Use these Apple tools instead:

  1. Safety Check. Go to Settings > Privacy & Security > Safety Check. Manage Sharing & Access lets you review who and what can see your information, while Emergency Reset stops sharing with all people and apps at once and walks you through your devices, trusted phone numbers and Apple Account password. Safety Check needs an Apple Account with two-factor authentication. Apple’s Safety Check guide explains each option and notes that some choices may be limited by Screen Time or a management profile.
  2. Your Apple Account. Change your Apple Account password, then sign in at account.apple.com, open Devices and remove any you don’t recognize. Apple’s article on a compromised Apple Account also suggests asking your carrier to confirm nobody set up text forwarding on your number.
  3. Your passcode. If someone else might know it, change it in Settings > Face ID & Passcode (or Touch ID & Passcode on iPhone SE).

For a full list of the Settings screens worth checking, see how to check if your iPhone has been hacked using Settings, starting with Safety Check and your signed-in devices. If you’ve already confirmed someone has access, the separate article on removing a hacker from your iPhone focuses on that situation.

Apple threat notifications and Lockdown Mode

Apple sends threat notifications to people it believes were individually targeted by mercenary spyware. A real one appears on the iPhone’s Lock Screen and in Settings, arrives by email at the addresses on your Apple Account, and shows as a banner when you sign in at account.apple.com. Apple says most users will never be targeted this way. A Safari pop-up or a text message claiming to be a threat alert is not one.

If you do get a real notification, or your work puts you at genuine risk, turn on Lockdown Mode:

  1. Update to the latest iOS first, so you get the full set of protections.
  2. Open Settings and tap Privacy & Security.
  3. Scroll down, tap Lockdown Mode, then tap Turn On Lockdown Mode.
  4. Tap Turn On Lockdown Mode again, then Turn On & Restart, and enter your passcode.

Expect the iPhone to behave differently afterward. Most message attachments and link previews are blocked, some websites load slowly or look broken, FaceTime calls from people you haven’t contacted recently are blocked, and configuration profiles can’t be installed. Apple lists every change in About Lockdown Mode and its page on threat notifications explains how genuine alerts are delivered.

Last resort: reset or erase the iPhone

Move on to this section only if the problem survives every step above. There is a gentler option first.

Option A: Reset All Settings (keeps your content)

Go to Settings > General > Transfer or Reset iPhone > Reset and choose Reset All Settings. This returns settings such as network, location, privacy, keyboard dictionary and Apple Pay cards to their defaults, but deletes no data or media. You will need to rejoin Wi-Fi networks afterward. On the same Reset screen, be careful not to tap Erase All Content and Settings by mistake. Apple describes each reset choice in resetting iPhone settings to their defaults.

Option B: Erase the iPhone and restore

Warning: Erase All Content and Settings deletes every photo, message, app and setting on the iPhone. Anything not in a backup or in iCloud is gone for good. Before you continue:

  • Back up the iPhone, or confirm that a recent backup exists in Settings > [your name] > iCloud > iCloud Backup.
  • Note which older backups you have. A backup made after the trouble started may bring the same profile or app setting back.
  • Know your Apple Account password, because you will need it to set the phone up again.
  • If you use an eSIM, the erase screen asks whether to keep or erase it. Keep it unless you’re giving the phone away; an erased eSIM means calling your carrier to reactivate service.

When you’re ready:

  1. Open Settings, tap General, then tap Transfer or Reset iPhone.
  2. Tap Erase All Content and Settings.
Transfer or Reset iPhone screen with the Erase All Content and Settings option
Erase All Content and Settings is below Reset in Transfer or Reset iPhone. This recreation follows the published current pane; no erase confirmation was opened or device reset performed.
  1. Enter your passcode or Apple Account password if asked, then tap Continue.
  2. When the iPhone restarts at the Hello screen, follow the setup steps until you reach Transfer Your Apps & Data.
  3. Choose From iCloud Backup (or restore from your computer) and pick a backup dated before the problem began. If you aren’t sure any backup is clean, set it up as new and download your apps again one by one from the App Store.

One catch with setting up as new: Apple notes that a device set up as new creates iCloud backups that replace your saved ones. If you might want an older backup later, restore it as soon as possible rather than waiting. Apple’s pages on erasing iPhone and restoring from a backup cover the computer method too, and this site’s article on restoring an iPhone by erasing, using a computer or a backup explains which restore fits which situation.

When a setting is missing or won’t change

  • VPN & Device Management is empty. That means no profiles are installed, which is good news. Move on to the other steps.
  • The profile won’t delete, or you see Remove Management instead. The phone is managed by an organization through mobile device management (MDM). Apple’s reset guide shows that Remove Management removes the organization’s settings and certificates. On a work or school phone, talk to that IT team before touching it.
  • Clear History and Website Data is gray. Apple says this means there is no data to clear, or that web content restrictions in Screen Time are on. Check Settings > Screen Time > Content & Privacy Restrictions, or ask whoever manages Screen Time on the phone.
  • There’s no Apps entry in Settings. Your iPhone is running an older version of iOS. Look for Safari directly in the main Settings list, or update iOS first.
  • Safety Check options are missing. Screen Time restrictions or a management profile can limit what Safety Check shows, and it requires two-factor authentication on your Apple Account.
  • The pop-ups come back after clearing Safari. Check Safari extensions and recently installed apps again, then repeat the Safari cleanup. Pop-ups that only appear on one website are coming from that site; stop visiting it.

How to tell the iPhone is clean

Use the iPhone normally for a day and check the symptom you wrote down at the start. Safari should open to normal pages without forced redirects, the spam calendar should be gone, VPN & Device Management should list only profiles you recognize, and Settings > General > Software Update should say iOS is up to date. If battery life was the worry, open Settings > Battery and see which apps use the most power over the last 24 hours. A familiar app at the top is normal; an app you don’t know is worth deleting.

To keep things that way, install apps only from the App Store, leave Automatic Updates on, don’t install profiles that a website or stranger sends you, and treat any page or message that says your iPhone has a virus as a scam.

Common questions about iPhone viruses

Do I need an antivirus or “cleaner” app?

No. Apps on iPhone can’t reach into other apps or the system, so a security app can’t scan your iPhone the way antivirus software scans a computer. Apple’s own protections (updates, App Store review, malware alerts for installed apps, Fraudulent Website Warning) do that job. Be especially wary of apps that you found through a pop-up claiming your phone is infected.

Can visiting a website give my iPhone a virus?

A website can show fake warnings, push you to install a profile or an app, or try to collect your passwords. Keeping iOS updated closes the security holes that rarer, more serious web attacks rely on. If you only looked at the page and didn’t install anything or type in personal details, clearing Safari’s data is usually all you need.

Will clearing Safari delete my saved passwords?

No. Apple says clearing history and website data doesn’t change your AutoFill information. You will be signed out of websites, so you may need to sign in again, and your browsing history is erased unless you use the Remove All Website Data option instead.

I tapped a link in a scam pop-up. What now?

Close the page and run through the steps above, paying attention to new apps and profiles. If you entered your Apple Account password, change it immediately and make sure two-factor authentication is on. If you entered card or bank details, call your bank.

Will erasing the iPhone definitely remove malware?

Erasing returns the iPhone to factory settings and removes everything you added, including apps and profiles. The risk is putting the problem back: restoring a recent backup can reinstall the same app or bring back settings. That’s why an older backup, or setting up as new, is safer.

Does turning on Airplane Mode help?

It cuts the iPhone off from the internet while you work, which can be reassuring if you think something is sending data. It doesn’t remove anything, so turn it off again once you’ve finished, because updating iOS needs a connection.

Once your iPhone looks normal again, take two minutes to make a fresh backup so you have a clean restore point if anything goes wrong in the future.

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook

Related

About WebPhoneTech Editorial Team

The WebPhoneTech Editorial Team writes and maintains the iPhone guides on this site. The team has more than 20 years of experience writing online tech guides and over 50 years of combined IT experience with small businesses, consumer products, mobile devices and applications.

Primary Sidebar

Browse topics

All iPhone guidesSafariChromeFirefoxDefault appsSecurity

Recent guides

  • How to Use Hide My Email on iPhone
  • How to Turn On AssistiveTouch on iPhone
  • How to Use Live Voicemail on iPhone
  • How to Remove a Bluetooth Device from Your iPhone 14
  • How to Download Offline Maps on iPhone
  • Contact
  • About Us
  • Privacy Policy

Copyright WebPhoneTech.com

Loading Comments...

You must be logged in to post a comment.