# Hide visible email addresses from trawling robots

**URL:** <https://forums.realmacsoftware.com/t/hide-visible-email-addresses-from-trawling-robots/47949>\
**Category:** Elements\
**Created:** [June 7, 2025, 9:23am UTC](https://forums.realmacsoftware.com/t/hide-visible-email-addresses-from-trawling-robots/47949 "2025-06-07T09:23:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugo](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/hugo/32/10935_2.png) [@Hugo](https://forums.realmacsoftware.com/u/Hugo)\
**Post date:** [June 7, 2025, 9:23am UTC](https://forums.realmacsoftware.com/t/hide-visible-email-addresses-from-trawling-robots/47949/1 "2025-06-07T09:23:32Z")

</div>

As in RW Classic with e.g. Doobox’s Obscure Stack, is there a way to hide visible email addresses and phone numbers from trawling robots?

---

<div class="post-metadata">

**Author:** ![Pegasus](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/pegasus/32/25035_2.png) [@Pegasus](https://forums.realmacsoftware.com/u/Pegasus)\
**Post date:** [June 7, 2025, 9:49am UTC](https://forums.realmacsoftware.com/t/hide-visible-email-addresses-from-trawling-robots/47949/2 "2025-06-07T09:49:05Z")

</div>

Maybe @Doobox already working on a version for elements …

---

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [June 7, 2025, 10:21am UTC](https://forums.realmacsoftware.com/t/hide-visible-email-addresses-from-trawling-robots/47949/3 "2025-06-07T10:21:45Z")

</div>

It is fairly easy to do this according to ChatGPT. I asked the question: “On a webpage (using Tailwind), how to hide visible email addresses and phone numbers from trawling robots?”

It returned examples:

- Obfuscate using HTML entities
- Use JavaScript to render the content dynamically
- Use CSS and reversed text trick
- Use images for contact info (not ideal for accessibility/SEO)

This is a reusable tailwind code:

```auto
<!-- Email and phone obfuscation component -->
<div class="space-y-2 text-sm text-gray-800">
  <div id="email" class="text-blue-600 underline cursor-pointer hover:text-blue-800"></div>
  <div id="phone" class="text-blue-600 underline cursor-pointer hover:text-blue-800"></div>
</div>

<script>
  // Obfuscation logic
  const user = "john";
  const domain = "example.com";
  const email = `${user}@${domain}`;
  const phone = "+1234567890";

  // Render into HTML
  document.getElementById("email").innerHTML =
    `<a href="mailto:${email}" aria-label="Email ${email}">${email}</a>`;

  document.getElementById("phone").innerHTML =
    `<a href="tel:${phone}" aria-label="Call ${phone}">${phone.replace(/(\+1)(\d{3})(\d{3})(\d{4})/, '$1 ($2) $3-$4')}</a>`;
</script>

```

This is PHP code:

```auto
<?php
  // Define contact info (don't put it in the HTML directly)
  $email_user = 'john';
  $email_domain = 'example.com';
  $phone_number = '+1234567890';
?>
<div class="space-y-2 text-sm text-gray-800">
  <div id="email" class="text-blue-600 underline cursor-pointer hover:text-blue-800"></div>
  <div id="phone" class="text-blue-600 underline cursor-pointer hover:text-blue-800"></div>
</div>

<script>
  // Email and phone data passed from PHP via JavaScript (safe in JS)
  const emailUser = <?php echo json_encode($email_user); ?>;
  const emailDomain = <?php echo json_encode($email_domain); ?>;
  const email = `${emailUser}@${emailDomain}`;

  const rawPhone = <?php echo json_encode($phone_number); ?>;
  const formattedPhone = rawPhone.replace(/^(\+1)(\d{3})(\d{3})(\d{4})$/, '$1 ($2) $3-$4');

  // Render links into the page
  document.getElementById("email").innerHTML =
    `<a href="mailto:${email}" aria-label="Email ${email}">${email}</a>`;

  document.getElementById("phone").innerHTML =
    `<a href="tel:${rawPhone}" aria-label="Call ${rawPhone}">${formattedPhone}</a>`;
</script>

```

All from ChatGPT.

I haven’t tested any of these. 😉

---

<div class="post-metadata">

**Author:** ![PMUK](https://avatars.discourse-cdn.com/v4/letter/p/7993a0/32.png) [@PMUK](https://forums.realmacsoftware.com/u/PMUK)\
**Post date:** [June 7, 2025, 8:42pm UTC](https://forums.realmacsoftware.com/t/hide-visible-email-addresses-from-trawling-robots/47949/4 "2025-06-07T20:42:28Z")

</div>

See the conversation in March at bottom of this post. [Dev Diary Ep66 - New Form Components](https://forums.realmacsoftware.com/t/dev-diary-ep66-new-form-components/46578)

---

<div class="post-metadata">

**Author:** ![Hugo](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/hugo/32/10935_2.png) [@Hugo](https://forums.realmacsoftware.com/u/Hugo)\
**Post date:** [June 9, 2025, 8:36am UTC](https://forums.realmacsoftware.com/t/hide-visible-email-addresses-from-trawling-robots/47949/5 "2025-06-09T08:36:55Z")

</div>

I tested the tailwind code and it works, but I think it can still be read by trawling robots.

I read the discussion at the bottom of the topic “Dev Diary Ep66 - New Form Components” and decided, pending further developments, to secure the form with Turnstile anyway.

My thanks for your responses: @Pegasus @logrunner @PMUK
