How to get rid of iPhone 4 virus?

How to get rid of iPhone 4 virus?

Only if you jailbreak it would you have a virus. Just restore it back to factory.

Iphone's don't get viruses. Its likely a fault in the software. I suggest you update it, and if that doesn't work, go to your nearest apple shop

Generally iPhone doesn't get virus, if you think your phone is infected then I would recommend you to visit nearest Apple Store to get rid of issue or you can try factory restore but get ready to lose all data and music if you doing factory restore. Here are some easy steps for factory restore in iPhone 4
• Begin the process, if possible, by backing up the data on your iPhone 4. Do this by syncing the phone (each time you sync, it creates a backup). This lets you save all your data and settings to restore to the phone after the reset.
• When that's done, locate the Settings app on your iPhone homescreen. If you've rearranged your apps, locate it wherever you put it. Tap the icon.
• Scroll down to the General menu. Tap it.
• Scroll all the way to the bottom to the Reset menu. Tap it.
• On this screen, you'll be presented with a number of reset options, ranging from just resetting all the iPhone 4's settings to resetting its dictionary or homescreen layout. The factory reset option is Erase All Content and Settings. If you're sure you want to factory reset your iPhone 4, tap it.
• You'll see a warning reminding you that you'll be erasing all music, other media, data, and settings if you do this. If that's not what you want to do, tap Cancel. Otherwise, tap Erase iPhone.
• It will generally take a minute or two to factory reset the iPhone, but when the process is done, you'll have a brand-new, pristine iPhone ready for whatever your next step is.