A Wix site has no theme folder, no plugin directory and no server files you can open. Wix is a hosted platform: Wix runs and patches it, and you control what sits on top. That changes how you hunt for injected code. Malicious scripts, hidden links and unexpected redirects can only come from a few places you control, so the search is short once you know where to look.
Why the usual file-comparison advice does not apply
On a self-hosted CMS you would compare theme files against a clean copy. On Wix there is no file system to compare, and you cannot be “self-hosted”. Your site’s code lives in the places below, and each one is something you or someone with access added.
- Custom Code in the site settings, which adds snippets to the head or body of pages.
- Embed elements on individual pages, such as HTML embeds and embedded third-party widgets.
- Velo code (if Dev Mode is turned on), including page code, public files and backend files.
- Apps installed from the Wix App Market.
- Collaborators and their roles, who can make any of the changes above.
If none of these contain something you cannot explain, the problem is likely outside the site itself, such as a compromised device or a third-party tag source you still trust.
Confirm what the visitor actually sees
Before you dig, capture the symptom so you can tell when it is fixed.
- Open the live site in a private window on a phone and on a desktop. Some redirects only fire for mobile visitors or for people arriving from a search result.
- Open the page source and the browser’s developer tools network tab. Note any script loaded from a domain you do not recognise.
- Search the page source for unfamiliar outbound links, especially ones hidden with tiny text, off-screen positioning or matching the background colour.
- Check how the site looks in search results. Spammy titles or unfamiliar pages in a site search point to injected links or pages.
Write down the offending domain or snippet. You will use it to find the source.
Review Custom Code first
Custom Code is the most common home for a rogue script, because it loads on every page it is applied to. Open the Custom Code area in your site settings and read every entry.
- For each snippet, check its name, which pages it loads on, and whether it sits in the head or the body.
- Look for obfuscated text: long strings of random characters, eval, atob, heavy escaping, or a script that builds another script tag at runtime.
- Look for
srcaddresses pointing to domains you do not recognise, or shortened links. - Match each legitimate snippet to a known purpose, such as analytics, a chat widget or an ad tag. Anything you cannot match should be treated as suspect.
Do not assume an item is safe because it has a familiar name. Open it and read the code. If you are unsure, copy it into a private note, remove it from the site, and test whether the symptom disappears.
Check embeds, Velo code and apps
Injected code can also sit on a single page, so a clean Custom Code panel does not clear the site.
Page embeds
Go through your highest-traffic pages and your homepage first. Click each HTML embed or embedded-site element and read its contents. Pay attention to elements that are tiny, transparent or placed off the visible canvas, since those are common ways to hide links or scripts.
Velo code
If Dev Mode is on, open the code files. Read page code, public files and backend files, and look for anything that redirects visitors, rewrites links in the page, or calls an external address you do not recognise. If you use Velo with a connected Git repository, compare the live site against the last commit you trust, which is the closest thing Wix has to a file comparison. If Dev Mode has never been used on the site, there should be no code files, so any you find deserve scrutiny.
Apps
Open your list of installed apps. Remove any you no longer use or do not remember adding. Apps can add scripts and widgets to your pages, so an abandoned app is both clutter and an unnecessary risk. For apps you keep, check what permissions they hold.
Check redirects and site history
A redirect that sends visitors elsewhere may not be in code at all. Review the URL redirect list in the SEO tools and delete any rule you did not create, especially ones pointing to other domains.
Wix also keeps a site history of saved versions in the dashboard. Use it to see when changes were made and, if a clean earlier version exists, to restore it. Restoring is a blunt tool: it can also undo legitimate edits, so note what you will need to redo and review the restored version rather than assuming it is clean. Availability and how far back history goes can vary, so check what your account shows.
Remove the code and lock the door
Deleting the snippet fixes the symptom. It does not fix how it got there. Work through this order.
- Remove the injected code and publish the site. Retest in a private window.
- Review collaborators and roles. Remove anyone who no longer needs access, and give each remaining person the lowest role that lets them do the job.
- Change your Wix password and the passwords of every collaborator. Use a unique password for each account, ideally from a password manager.
- Turn on two-factor authentication for your account and require it of collaborators.
- Check the email accounts tied to the site, since control of the email lets someone reset the Wix password.
- Rotate keys and tokens. If Velo code or an app stores API keys or secrets, replace them at the source service and update the site.
- Scan the devices used to manage the site, because stolen saved logins are a common route in.
If you cannot explain how the code arrived, contact Wix support through the Wix Help Center and describe what you found.
Prevent a repeat
Treat every addition to the site as something that must be justified.
- Keep a short written list of every Custom Code snippet and embed, with its purpose and owner.
- Add third-party scripts only from vendors you know, and remove them when a campaign ends.
- Check the Custom Code panel, installed apps and collaborator list on a regular schedule.
- Where a service supports it, restrict which domains scripts may load from. The MDN page on Content Security Policy explains the idea, though on a hosted builder your ability to set headers may be limited.
- Read the OWASP material on cross-site scripting so you recognise how injected scripts behave.
Frequently asked questions
Can a Wix site be hacked through a theme vulnerability like on WordPress?
Wix does not use installable theme files or server plugins that you update yourself, so that specific route does not exist. Injected code on Wix generally arrives through account access, Custom Code, embeds, Velo code or installed apps.
How do I know the site is clean after removing the code?
Retest in a private window on phone and desktop, view the page source for unfamiliar domains, and review search results for odd pages. Recheck after a few days, since an unchanged access problem lets the code return.
Should I restore an earlier version of the site?
It can help if you know a version predates the problem, but it also reverts good edits. Restore only after identifying a clean version, then still review Custom Code, collaborators and passwords.