On this page
What this issue is
Cryptojacking means using someone else's computer to mine cryptocurrency without asking. On a website, the attacker adds a script to your pages. When a visitor opens the page, their browser runs it and burns CPU power for the attacker's profit. You pay nothing directly, but your visitors do, and they blame you.
Why it costs you leads or sales
Example: illustrative load times on a mid-range phone. Real numbers depend on the miner and the device.
The visitor opens your page, a hidden script starts mining, the page lags and the visitor leaves.
How to check if your site has it
Notice the symptoms
Open your site on a laptop and listen for the fan. Open Task Manager (Windows) or Activity Monitor (Mac) and see if the browser tab uses a lot of CPU while the page sits idle.
List every script the page loads
In Chrome, open DevTools (F12), go to the Network tab, filter by JS and reload. Note each domain. Look for domains you do not recognise.
Search the page source
Press Ctrl+U (Cmd+Option+U on Mac) and search for words such as coinhive, cryptonight, coin-hive, miner, wasm, stratum and webminer. Also look for long strings of unreadable code, eval( and atob(.
Check the Performance tab
In DevTools, record a few seconds on the idle page. Constant heavy scripting or web workers you cannot explain are suspicious.
Compare against files you know
Check recently changed files, your theme, your tag manager containers and the custom code areas of your site builder.
How to fix it
Put the site in maintenance mode if you can
This stops more visitors being affected while you clean.
Remove the injected code
Delete the script tag or file. Remove it from every place it was added (see the platform tabs below).
Change every credential
Reset admin, hosting, FTP/SFTP, database and tag manager passwords. Turn on two-factor authentication. Remove users you do not recognise.
Update everything
Update the CMS, plugins, themes and any libraries. Delete plugins and themes you do not use.
Restore clean files if needed
If you cannot find all the changes, restore from a backup made before the infection and then update immediately.
Clear caches
Purge your CDN, plugin cache and server cache so visitors stop getting the infected version.
Check theme and plugin files
Look in header.php, footer.php and functions.php of your theme, and in any 'insert headers and footers' plugin settings. Reinstall WordPress core, plugins and themes from fresh copies.
Search the database
Injected code is often stored in wp_posts, wp_options and widget text. Search for the suspicious domain or strings like coinhive.
Check users
Go to Users and delete unknown administrators. Reset all passwords.
Check theme code
Go to Online Store > Themes > Edit code. Search theme.liquid and other files for unknown script tags.
Check apps and customer events
Under Settings > Apps and sales channels, remove apps you do not use. Under Settings > Customer events, review custom pixels.
Review staff accounts
Go to Settings > Users and remove unknown staff, then reset passwords.
Review Custom HTML tags
Open each container and check every Custom HTML tag and custom template for unknown domains or obfuscated code.
Check version history and users
Under Admin > User management, remove unknown users. Use Versions to see who published changes and roll back to a clean version.
Check custom code
Open Project settings > Custom code (head and footer) and each page's custom code settings. Remove unknown scripts, then publish.
Review members and integrations
Remove unknown workspace members and unused apps.
Check tracking code areas
Review the header and footer tracking code in funnel and website settings, and in each page's custom code element. Remove unknown scripts.
Review team users
Remove unknown team members and reset passwords.
Check Custom Code
In Settings > Custom code, remove unknown snippets. Also check Velo code and installed apps.
Review contributors
Remove unknown site collaborators and change your password.
Check code injection
Open Website > Pages > Custom code (Code injection). Review Header, Footer and the Lock page area, and check page-level code injection too.
Review contributors
Remove unknown contributors and reset your password.
Compare with version control
Run a diff against your last known clean commit. On a server without version control, sort files by modified date and review recent changes.
Search the codebase
Search for suspicious domains and strings with the command below.
grep -rIlE "coinhive|coin-hive|cryptonight|webminer|stratum\+tcp" /path/to/your/site
# list files changed in the last 14 days
find /path/to/your/site -type f -mtime -14How to confirm it's fixed
- View source and search again for the script domain and miner keywords: nothing found.
- Network tab shows no requests to unknown domains.
- Idle CPU use of the page tab is normal.
- Test in a private window and on a phone using mobile data.
- Caches and CDN are purged.
- All passwords reset and two-factor authentication on.
- No unknown admin users or staff accounts remain.
- Check again after 24 hours in case a hidden backdoor re-injects the code.
How to prevent it happening again
- Turn on automatic updates for core, plugins and themes where safe.
- Use unique strong passwords and two-factor authentication for every admin login.
- Remove unused plugins, themes, apps and old users.
- Keep a written list of the third-party scripts your site should load.
- Limit who can publish in your tag manager.
- Add a Content Security Policy that only allows script sources you trust.
- Keep off-site backups and test restoring them.
<meta http-equiv="Content-Security-Policy" content="script-src 'self' https://www.googletagmanager.com https://www.google-analytics.com;">How FunnelGuard handles this
- Weak entry pointOld plugin or stolen login
- Script injectedAdded to theme or tag manager
- Visitor loads pageBrowser runs the miner
- Page slows downForms and checkout lag
The break happens at the entry point; every visit after that runs the script.
Frequently asked questions
Questions people ask
How do I know if my website has a crypto miner?
Check for high CPU use on an idle page, a slow site and unknown script domains in the Network tab of your browser's DevTools. Also search the page source for words like coinhive, cryptonight and miner. Review your theme, custom code areas and tag manager too.
Why is my website slow and making my computer fan spin?
One possible cause is a hidden crypto-mining script using your processor. Other causes include heavy ads, large images and too many plugins. Check the Network and Performance tabs in DevTools to see which scripts consume the most time.
How do I remove a crypto miner script from my website?
Back up the site, then delete the injected script from your theme, database, custom code areas and tag manager. Reset all passwords, remove unknown users, update everything and clear caches. If you cannot find it all, restore a clean backup and update at once.
How did a crypto miner get onto my site?
Usually through an outdated plugin or theme, a stolen admin, FTP or tag manager login, or a compromised third-party script. Finding the entry point matters, because removing the script alone lets the attacker put it back.
Can a Google Tag Manager tag contain a miner?
Yes. A Custom HTML tag or custom template can load any script, including a miner. Review every Custom HTML tag, check user access and use version history to roll back unexpected changes.
Will FunnelGuard alert me if a crypto miner is injected?
Only partly. It does not flag unknown third-party scripts, so a quiet miner may not trigger an alert. It does catch broken journey steps, failed forms and missing tracking that a miner might cause, so pair it with a monthly manual script review.
Is a crypto miner on my site a sign of a bigger hack?
Often yes. Someone had write access to your files, database or tag manager, so they may have added other malware, backdoors or admin users. Check for those and reset every credential.
Related issues
- OPS-147Injected popups / malvertisingFix guide
- OPS-148Rogue admin user createdFix guide
- OPS-149Backdoor files (web shells) on serverFix guide
- OPS-150Search Console security issues / manual actionsFix guide
- OPS-153Antivirus vendors flag domainFix guide
- OPS-151Browser extension-like injected ads on siteFix guide