Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Hidden spam links in footer: how to find and remove them

OPS-143Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

Hidden spam links are outbound links added to your pages without your knowledge. They often sit in the footer because that part of the template loads on every page. The attacker hides them so you do not notice, but search engines still read them.

Common hiding tricks include display:none, visibility:hidden, font-size:0, text with the same colour as the background, or a box pushed far off screen with position:absolute; left:-9999px. The links usually point to pharmacy, casino, loan or adult sites.

The code can live in several places: the theme's footer.php or footer template, a widget, a database option, a plugin, a script injected from another domain, or a tag in Google Tag Manager.

Why it costs you leads or sales

Visitors rarely see the links, so the direct damage is quiet. The cost comes from what they signal and what usually comes with them.

How hidden footer links hurt you
  • Search engines may treat your site as spammy or compromised, which can lower rankings for the pages that bring in leads.
  • Your site passes trust to unrelated, often shady, sites.
  • A hack that added links often added other things too: redirects, spam pages or a backdoor.
  • If Google or a browser flags the site, visitors see warnings and leave.
  • Page weight and load time can rise if the injected code loads extra scripts.
How a footer injection unfolds
  1. Weak entry pointOutdated plugin or stolen password
  2. Code injectedLinks added to footer template or database
  3. Every page serves linksHidden with CSS
  4. Search trust dropsSpam signals, possible warnings

The break happens at the entry point; everything after it carries the hidden links.

How to check if your site has it

Look for hidden links
  1. View the page source

    Open your homepage, right-click and choose View page source (or press Ctrl+U). Search for display:none, left:-9999, font-size:0 and visibility:hidden near the bottom of the file.

  2. List all outbound links

    Search the source for <a href="http and scan for domains you do not recognise, especially pharmacy, casino or loan sites.

  3. Check as a search engine would

    Some injections only show to crawlers. Use the URL Inspection tool in Google Search Console, then View crawled page, and read the HTML for unknown links.

  4. Search Google for spam terms

    Search site:yourdomain.com viagra, site:yourdomain.com casino and similar. Results mean spam is indexed.

  5. Check Search Console

    Open Security & Manual Actions and look for any security issue reports.

  6. Disable JavaScript and compare

    Compare the page with and without scripts. Links that appear only with scripts point to an injected script or tag.

How to fix it

Take a full backup first so you can investigate later. Then remove the links and the way they got in. The location depends on your platform.

Remove the injected links by platform
  1. Check the theme footer

    Go to Appearance > Theme File Editor (or use SFTP) and open footer.php. Look for unfamiliar links or long encoded strings such as base64_decode or eval.

  2. Check widgets and options

    Review Appearance > Widgets and footer settings in your theme. Search the database (wp_options, wp_posts) for the spam domain with phpMyAdmin.

  3. Reinstall core, themes and plugins

    Reinstall WordPress core from Dashboard > Updates, and replace themes and plugins with fresh copies from trusted sources. Delete unused or nulled plugins.

  4. Scan and check users

    Run a malware scanner plugin, and check Users for admin accounts you do not recognise.

Find files containing a spam domain or suspicious functions (replace the domain)bash
grep -rIl "spam-domain.example" /path/to/site
grep -rIn "base64_decode\|eval(" /path/to/site --include=*.php
find /path/to/site -type f -mtime -7
Close the way in
  1. Change every password

    Reset admin, hosting, database, FTP and email passwords, and turn on two-factor authentication where offered.

  2. Update everything

    Update the CMS, themes, plugins and apps. Remove anything abandoned.

  3. Remove unknown users and files

    Delete rogue admins and unfamiliar files. If you find a backdoor, treat it as a bigger compromise and consider restoring a clean backup or asking your host for help.

  4. Request a review if flagged

    If Search Console reported a security issue, fix it first, then request a review there.

Footer before and after cleanup

Compromised

  • Unknown links to pharmacy or casino sites
  • Hidden with display:none or off-screen CSS
  • Injected code in the theme, database or tag manager
  • Entry point still open

Cleaned

  • Only links you added
  • Clean files restored from a trusted source
  • Passwords changed, software updated
  • Unknown users removed

How to confirm it's fixed

Confirm the cleanup
  • View page source on several pages and find no unknown outbound links.
  • Use Search Console URL Inspection and check the crawled HTML is clean.
  • Clear all caches: plugin, server and CDN.
  • Search site:yourdomain.com plus spam words and see whether results disappear over time.
  • Re-scan files and check no unknown users or recently modified files remain.
  • Check again after a day and a week in case a hidden backdoor reinjects the code.

How to prevent it happening again

Prevention habits
  • Turn on automatic updates for security releases of your CMS and plugins.
  • Use strong unique passwords and two-factor authentication for every admin account.
  • Give users the lowest role they need.
  • Remove unused plugins, themes and apps, and never use nulled (pirated) ones.
  • Keep offsite backups so you can restore a clean version.
  • Lock down tag manager publishing rights.
  • Add Search Console and set up email notifications for security issues.
  • Check the footer source monthly.

How FunnelGuard handles this

FunnelGuard does not check for hidden spam links in your footer today. It is a possible future check. FunnelGuard is a synthetic monitoring service: a robot visitor runs your real journeys such as lead forms, checkouts and booking buttons on a schedule, checks each step and the tracking hits, and confirms test leads arrive.

Nearby, that can help you notice the effects of a compromise that breaks a journey, for example a form that stops working, a step that fails or tracking that stops sending. It will not tell you a hidden link exists.

To watch for hidden links, use Google Search Console security reports and email notifications, run a regular malware scanner for your platform, and view the page source of key pages monthly. You can also run a free FunnelGuard read-only website audit, but it does not replace a malware scan.

Questions people ask

Why are there links in my website footer that I did not add?

Most likely your site was hacked. Attackers inject links into the footer to sell advertising or boost other sites, often through an outdated plugin, a weak password or a rogue tag. Treat it as a security incident and look for the entry point, not just the links.

How do I find hidden links on my website?

View the page source and search for display:none, left:-9999, font-size:0 and unfamiliar <a href domains. Then check the crawled HTML in Google Search Console URL Inspection, since some injections only show to crawlers.

Where do hidden spam links in the footer come from?

They usually come from a hacked theme file such as footer.php, a modified database entry or widget, a compromised plugin, or a malicious tag or script. The attacker gained access through a vulnerability or stolen login.

Will hidden footer links hurt my SEO?

They can. Search engines may see your site as spammy or compromised, and spam pages or security flags that often come with the hack can reduce visibility. Removing them and fixing the entry point is the best response.

Is it enough to delete the spam links?

No. If you leave the entry point open, the links usually come back. Change all passwords, update software, remove unknown users and files, and check again after a few days.

Does FunnelGuard detect hidden spam links in the footer?

No. FunnelGuard does not check for this yet. It monitors your funnel journeys, tracking hits and lead delivery, so use Search Console, a malware scanner and manual source checks for hidden links.

How often should I check my footer for hidden links?

Check key pages monthly by viewing the source, and after any plugin or theme change. Also keep Search Console security notifications on so Google can email you if it finds an issue.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: site safety (Stage 26, daily): spam words in the home page's code.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.