Warning icon
MacPaw stands with Ukraine. Here’s how you can help our country win with just several clicks.

How to get rid of a virus on your iPhone

342.8K views
9 min read

Though iPhone viruses are rare, they can happen. Typically, this occurs through a few different methods, but it’s almost never totally your fault.  

Hackers are clever and are always finding new ways to infect devices for nefarious purposes. You can get a virus from clicking links you don't recognize or downloading sketchy apps. 

A common method for hackers to load viruses and malware on your iPhone is via iMessage.  

You’ll get a message telling you something urgent, and encouraging you to click a link to resolve an issue or claim a prize. When you do, your phone is subject to whatever is on the other end – and it’s almost never good. 

If you believe your iPhone has a virus, we’ll show you how to clean your phone from virus threats, how to get rid of a virus on your phone, and discuss some apps that can help keep your iPhone safe.

How to find out if my iPhone has a virus or other malware?

Plainly put, your iPhone will be acting strangely. Devices with viruses or malware are often slow, and can hijack normal functionality, like search. This is why removing viruses from iPhone or iPad is so important. Here are the most common signs your iPhone might be infected: 

  • App-related issues. Maybe your apps start crashing or you notice some unfamiliar apps on your iPhone — these are some serious symptoms. Note that apps are a direct way for hackers to gain entry to your phone. Developers often use snippets of code called APIs that are open source to access services in the cloud, and hackers have been known to inject malware and viruses into APIs. 
  • Unusual battery drain or data usage. It’s a good idea to always keep an eye on your iPhone performance — how long can it go without a charge, how slow or fast it is on certain networks, and how much data it uses up on a daily basis. The moment you notice any weird patterns, it’s time to learn how to clean your phone from virus. 

You were charged for something you never purchased. This is a worrying sign the perpetrators might have gained access to your personal accounts.

Though this article will show you how to clean your iPhone from virus threats, prevention is still the best path forward. Don’t click links you’re not confident in, and don’t download sketchy apps from any source.

How To Remove a Virus from iPhone

Apple does a really good job of keeping the iOS ecosystem locked. The ‘walled garden’ keeps virus threats at bay. The code developers submit is checked routinely for suspicious API calls or strange text. Though some threats have been detected, Apple’s diligence keeps the volume of viruses on iPhone really low.

Still, we’re never 100% safe. Let’s discuss how to get rid of virus on phone and prevent common malware threats.

Delete apps that look suspicious

Dig through the apps on your phone: do any look suspicious? Do you recall downloading each of them, and do you use them often enough to keep around?

The answer to “how do i get a virus off my iPhone?” is often as simple as deleting an app. Apps have associated files, and deleting them typically removes the files they imported. All you need to do is press and hold on the app icon, and select “Remove App” from the menu that appears. 

delete app iphone

Clear history and website data

Understanding how to delete virus from iPhone history is critical, too. Viruses can live in your browser history or website data, especially if you revisit a suspect website on your phone often. Viruses can re-inject files onto your phone, perhaps doing more damage. 

Here’s how to reset your website history and data:

  1. Open the Settings app on your iPhone
  2. Select “Safari”
  3. Select “Clear History and Website Data”
  4. Choose “Clear History and Data” from the menu that appears

Clear History and Data iphone

Restart your iPhone

Viruses and malware often happen while your phone is operating, and shutting your phone off completely can stop a virus or malware from working. It’s a simple measure that can answer the question “how to get malware off iPhone.”

Keep in mind you will have to shut your phone down; putting it into Airplane Mode won’t do the trick. All you have to do is hold down the power button on the left side of your iPhone and the volume up button on the right side for a few seconds. On the screen that appears, slide the icon at the top of the screen to power your phone off.

Restore your phone from a previous backup version

Apple provides a small sliver of iCloud storage for backups, but it’s often not enough to store many backups. It’s also not a useful method if you’ve had a virus on your phone for a long while. Each backup iCloud has may also be corrupted!

This is why it’s best to have your own backup program, and why AnyTrans is an app you should download for Mac right away.  

AnyTrans allows you far more control over your backups than Apple allows via iCloud. The app allows you to download any files or folders to your Mac, and sync iOS devices to your Mac’s storage. The wired connection to your Mac also sidesteps the often clumsy iCloud syncing protocols, and lets you get direct access to backups of your iPhone stored on your Mac or an associated external drive.

Because you have full control of where your backups are housed – and how many you hold onto – you can keep a reliably safe backup of your iPhone tucked away, and restore to it if you ever run into issues with viruses or malware on your iPhone.

anytrans ios

Factory reset your iPhone

If all else fails, or you simply want to start completely over with your iPhone, you can always reset your device to factory settings and start anew. Know that any data you haven’t backed up will be lost, so it’s a good idea to take advantage of everything AnyTrans has to offer before going this route.

First, you’ll need to remove your iPhone from Find My iPhone, if it’s enrolled. Here’s how:

  1. Open the Settings app on your iPhone
  2. Select your name banner at the top of the screen
  3. Select ‘Find My”
  4. Select “Find My iPhone”
  5. Toggle all settings off

find my iphone

To reset your phone to factory settings, follow these steps:

  1. Open the Settings app on your phone
  2. Select “General”
  3. Select “Transfer or Reset iPhone”
  4. Select “Erase All Content and Settings”
  5. Enter the passcode for your iPhone
  6. Tap “Erase”

Your phone will begin the process of deleting all of your data and settings. It will then reboot as though it were a brand new phone.

Update iOS

Outdated operating systems are the most fertile soil for viruses. Enable automatic software updates on your iPhone to enhance the level of protection and ensure you’re following the latest security standards. Here’s how to update iOS and set up automatic updates: 

  1. Open Settings on your phone
  2. Go to General > Software Update
  3. If there’s a pending update, tap Download and Install
  4. Once you’ve updated iOS, go back to Software Update and set Automatic Updates to On. 

How to protect your iPhone or iPad from viruses 

Remember, preventing issues is far better than solving them! Now that you know to never click a link you’re not totally sure is legitimate, here are a few extra tips to ensure you never get another virus on your phone: 

  • Use trusted VPN. You already know that most malware threats come from the web. ClearVPN is one of the best tools to secure and encrypt your connection, especially if you’re browsing on the go and connecting to public networks. 

clear VPN
  • Download apps from trusted services. Always download apps from the App Store or services such as Setapp, and never ‘sideload’ apps from the web or untrustworthy marketplace. When downloading apps, always read reviews. If an app has a low rating, it may be because users notice signs of a virus without understanding the app is at fault.

  • Keep iOS updated. Each time Apple updates iOS, it comes with tons of security improvements. Apple never discusses what fixes it has made, but the latest version of iOS is always the safest. Similarly, don’t download older iOS builds unless it’s directly from Apple. Even if you’re not crazy about the latest and greatest version of iOS, it’s safer than downloading iOS from somewhere else, which could itself carry viruses and malware.

  • Keep apps updated. You know how app updates often say “bug fixes and improvements”? That’s because ‘bugs’ and ‘improvements’ are often security patches! Always keep your apps up to date. Apps that haven’t delivered updates in a long while may be carrying malware, too. Remember how we told you Apple checks code for suspicious activity? If a developer knowingly added a virus to their app and ships an update, Apple will check the code and hackers can be caught.

Pro tip: free gigabytes from unused file and photos

Keeping your Mac and iPhone in sync is popular, as having the same files, folders, and images across all of your devices just makes life easier. You can free up precious space for your synced apps, files, folders, and images with Gemini.

Gemini

Gemini is dedicated to finding duplicate files, and deleting them if you choose. Your iPhone and Mac being totally harmonious sometimes means files and images are duplicated, causing unnecessary storage space to be occupied. You could ignore this, but why? Duplicate files are just clutter you don’t need.

Cleaning your Mac with Gemini and syncing your folders and images to iPhone ensures storage across your devices remains clear and concise, and you only keep the files you really want and need.

Keep your iPhone protected with Setapp

Viruses on Mac are never fun to deal with, so be sure to take preventive measures. The last thing you’d want to do is have to reset your phone just because you clicked a strange link in a text message! Setapp can help you stay on the mission.  

AnyTrans, ClearVPN, and AnyTrans — three apps that are available with Setapp membership — will help keep your iPhone synced, backed up, and free of unwanted files. Sign up for Setapp and try all of them for free, plus over 240 other useful apps for Mac and iPhone. When your trial ends, access to Setapp is only $9.99 per month.

FAQ

Wrapping up with the top three questions people usually ask alongside the ultimate “how do I clean my iPhone of viruses?” 

Can an iPhone get a virus from Safari?

Not from Safari itself, but it’s possible to get your iPhone infected via Safari. Just as any other browser, Safari can be a getaway for malicious programs and viruses. This is why it’s important to avoid clicking on links and ads on the websites you don’t trust, and generally avoid suspicious-looking websites. 

Can an iPad get a virus?

As for iPad, the situation is similar to iPhone. Although Apple carefully checks every app that’s submitted to the App Store and maintains high security standards for both devices, it’s still possible to become a victim of a phishing attack if you click on a wrong link or get tricked into disclosing your credentials or financial information. So it’s important to follow the same tips we outlined above to keep your iPad protected. 

Why do I get virus warnings on my iPhone?

Apple never shows virus warnings, so if you see one, it’s definitely a scam. Make sure you never click on such pop-ups and warning messages. The first thing to do once you see such a thing on the web is to clear your browser history — we’ve explained how to do it for Safari in the tips above. Next, learn how to clean your phone from virus to never fall prey to such malicious attempts again.  

Get 230+ Mac apps for any job

Sign up to Setapp and try them for free.