Skip to content

How to Hide Email from Spam Bots in WordPress?

Key Takeaways

{"bullets":["Nexter Extension includes a built-in email obfuscation tool that hides email addresses from spam bots in WordPress while still displaying them normally to human visitors.","The [obfuscate] shortcode reverses and encodes the email in the page source, and [obfuscate email="john@example.com" link="yes"] creates a clickable mailto link without placing the address in the source.","Advanced Security in Nexter → Extensions → Security enables the Hide Email from Spam Bots toggle, then Save activates the protection.","View Page Source with Ctrl+U or Cmd+Option+U confirms protection because the raw source shows reversed text and an encoded data-nxt-mail value, not plain mailto:john@example.com."]}

Table of Contents

What It Does

Hide Email from Spam Bots adds an [obfuscate] shortcode. You put the shortcode where an email address should appear. Visitors see a normal address. The address in the page source is reversed, split and encoded so that simple scrapers do not read it as plain text.

It is a Nexter Extension Pro feature, found in the Security section of Nexter Extension.

Why It Matters

Email addresses typed in plain text are easy for bots to harvest, and the result is spam in your inbox. You still want visitors to find a contact address, so removing it is not an option.

What You Get

  • The [obfuscate] shortcode with these attributes: email, link, subject, text, display and class
  • An optional clickable email link with a pre-filled subject
  • Output that also works in text widgets

Benefits

  • Less harvested spam on your public contact address
  • No separate plugin. You add a shortcode where the address should appear
  • Works as a plain address or as a working mailto link

Capabilities

AttributeDefaultWhat It Does
emailRequiredThe address to protect. It must be a valid email address, otherwise nothing is shown.
linknoSet to yes for a clickable mailto: link. With no the address is shown as text.
subjectEmptyPre-fills the email subject. Only used when link="yes".
textEmptyShows your own wording, for example Email us, instead of the address.
displaynewlineinline shows it inside a line of text, block shows it as a block and newline puts it on its own line.
classEmptyAdds your own CSS class for styling.

How It Works

  • Text mode (link="no"): the address is output as text. In most browsers the characters are stored reversed and flipped back by CSS. In Firefox and on iPhone the characters are stored in order and the direction is set with CSS. A hidden span with a random string sits before the @ sign, and the @ sign is written as a character code.
  • Link mode (link="yes"): the plugin builds the mailto: link on the server with the WordPress antispambot() function, which writes the address as HTML character codes. Browsers turn the codes back into a working address. No JavaScript is needed. The link carries rel="nofollow" and the class nxt-obfuscate-mail.

How to Use It

Turn It On

  1. In the WordPress dashboard, go to Nexter > Nexter Extension > Security.
  2. In the Advanced Security card, turn it on and click Configure.
  3. In the panel, enable Hide Email from Spam Bots and click Save.
Nexter Security screen with the Security item selected in the sidebar and the Advanced Security card turned on
Nexter Extension Advanced Security panel with the Hide Email from Spam Bots setting highlighted and the Save button marked

Turning it on does not change any email on your site. You add the shortcode wherever you want a protected address.

Add the Shortcode

Show an address as text:

[obfuscate email="john@example.com"]

Show a clickable link. Add link="yes":

[obfuscate email="john@example.com" link="yes"]

Pre-fill the subject line:

[obfuscate email="john@example.com" link="yes" subject="Website Inquiry"]

Show the address inline, or show custom link text:

[obfuscate email="sales@example.com" display="inline"]
[obfuscate email="sales@example.com" link="yes" text="Email our team"]
[obfuscate email="sales@example.com" link="yes" subject="Support" class="my-email"]

Check That It Works

  1. Open the published page and use your browser’s View Page Source option (in most browsers Ctrl + U on Windows). Do not use Inspect Element, which shows the page after the browser has processed it.
  2. Search the source for your address, for example john@example.com.
  3. You should not find it as plain text. You will see split text, a hidden span and character codes such as @. In most browsers the visible text is also stored reversed.
Email address john@john.com on a page, next to the browser inspector showing the address split around a hidden span

Use Cases

  • Contact and About pages
  • Footers and business listings
  • Author profile pages and member directories

Limitations

  • Pro only. The toggle is in the free plugin dashboard, but the shortcode needs Nexter Extension Pro.
  • Shortcode only. Turning the option on does not rewrite email addresses already on your site.
  • An invalid email in the shortcode shows nothing at all.
  • This stops simple scrapers. A bot that decodes HTML character codes, or loads the page in a real browser, can still read the address. Treat it as a way to reduce spam, not as a guarantee.
  • A separate plain mailto: link in a button or widget URL field is not protected. Use link="yes" for the clickable address.

Troubleshooting

  • The shortcode shows as text on the page, for example [obfuscate email=…]. The Hide Email from Spam Bots setting is off, was not saved, or Nexter Extension Pro is not active. Enable it again in Security > Advanced Security and click Save.
  • Nothing appears where the shortcode is. The email value is not a valid address. Check for a typo or an extra space.
  • The address is still visible in the page source. Look for a second place that holds it: a plain mailto: in a button URL field, or the address typed in text. Replace those with the shortcode.
  • The address looks reversed in the code view. That is expected in text mode. The browser flips it back for visitors.

Suggested Reading

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!