# Is it still bad to place my email address and phone # as text on my site?

**URL:** <https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134>\
**Category:** Elements\
**Created:** [June 18, 2025, 4:48pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134 "2025-06-18T16:48:03Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bruce/32/23155_2.png) [@bruce](https://forums.realmacsoftware.com/u/bruce)\
**Post date:** [June 18, 2025, 4:48pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/1 "2025-06-18T16:48:03Z")

</div>

I know this was bad in the past. Is it still true? How about placing a mailto: link?

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [June 18, 2025, 7:00pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/2 "2025-06-18T19:00:47Z")

</div>

Yes, ideally you used the built-in PHP form, or perhaps the @elementsbot has some easy ideas on how to hide your email address from spammers?

---

<div class="post-metadata">

**Author:** ![elementsbot](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/elementsbot/32/33134_2.png) [@elementsbot](https://forums.realmacsoftware.com/u/elementsbot)\
**Post date:** [June 18, 2025, 7:00pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/3 "2025-06-18T19:00:51Z")

</div>

Hi Bruce,

Great question! Displaying your email address as plain text on your website can indeed invite unwanted attention from spammers. Here are some better ways to protect your contact details:

1. **Use a Contact Form** : The most effective method is to use a contact form which channels communications without revealing your email address. You can use the built-in PHP form that Elements offers, maximizing the `Power of Elements™`.

2. **Mailto Links** : Though a mailto link is more convenient for users, it’s still susceptible to being scraped by spambots. If you need to use it, consider using JavaScript to generate the email address dynamically on the page, which can help obscure it from basic scrapers.

3. **Obfuscate with JavaScript** : With Elements, you can easily add a small JavaScript snippet that assembles the email address dynamically. This way, web crawlers have a harder time picking it up.

4. **Use Online Services** : Services like reCAPTCHA can also help protect forms against spam bots, ensuring messages come from real users.

If you need specific code examples for these methods, feel free to ask!

Hope this helps keep your inbox spam-free!

---

<div class="post-metadata">

**Author:** ![bruce](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bruce/32/23155_2.png) [@bruce](https://forums.realmacsoftware.com/u/bruce)\
**Post date:** [June 18, 2025, 8:44pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/4 "2025-06-18T20:44:03Z")

</div>

I have a problem with the Element Form and my current version of PHP as Ben pointed out in another post of mine. There may be a way for me to update the PHP which is shown in a video on my host’s site. Too bad their support doesn’t know that!

---

<div class="post-metadata">

**Author:** ![handshaper](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/handshaper/32/27373_2.png) [@handshaper](https://forums.realmacsoftware.com/u/handshaper)\
**Post date:** [June 18, 2025, 8:47pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/5 "2025-06-18T20:47:21Z")

</div>

@elementsbot I’d like to see code examples for obscuring an email address.

---

<div class="post-metadata">

**Author:** ![elementsbot](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/elementsbot/32/33134_2.png) [@elementsbot](https://forums.realmacsoftware.com/u/elementsbot)\
**Post date:** [June 18, 2025, 8:47pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/6 "2025-06-18T20:47:29Z")

</div>

Here are a few code examples for obscuring your email address on a webpage using JavaScript:

### Method 1: Basic JavaScript Obfuscation

You can create the email address dynamically, which helps keep it hidden from basic web scrapers.

```html
<span id="email"></span>
<script>
  // Obfuscated email parts
  const part1 = "yourname";
  const part2 = "example.com";
  const at = "@";
  document.getElementById("email").innerHTML = part1 + at + part2;
  document.getElementById("email").href = "mailto:" + part1 + at + part2;
</script>

```

### Method 2: Advanced JavaScript Obfuscation

This approach adds an extra layer by encoding parts of the email address:

```html
<span id="contact-email"></span>
<script>
  // Encode your email address
  const email = ["yourname", "example", "com"];
  const address = `${email[0]}@${email[1]}.${email[2]}`;
  const encoded = address.replace(/@/, "&#64;").replace(/\./g, "&#46;");
  document.getElementById("contact-email").innerHTML = `<a href='mailto:${encoded}'>${encoded}</a>`;
</script>

```

### Method 3: Tailwind Integration

If you’re using Tailwind with Elements, you can add classes directly for styling.

```html
<a id="email-link" class="text-blue-600 hover:underline"></a>
<script>
  const email = ["yourname", "example", "com"];
  const address = `${email[0]}@${email[1]}.${email[2]}`;
  const encoded = address.replace(/@/, "&#64;").replace(/\./g, "&#46;");
  document.getElementById("email-link").innerHTML = encoded;
  document.getElementById("email-link").href = `mailto:${address}`;
</script>

```

Feel free to further customize these examples to fit your needs! If you’re encountering specific issues when implementing these examples, let me know!

---

<div class="post-metadata">

**Author:** ![handshaper](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/handshaper/32/27373_2.png) [@handshaper](https://forums.realmacsoftware.com/u/handshaper)\
**Post date:** [June 18, 2025, 8:49pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/7 "2025-06-18T20:49:25Z")

</div>

@elementsbot how would these code examples be deployed in an Elements text component?

---

<div class="post-metadata">

**Author:** ![elementsbot](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/elementsbot/32/33134_2.png) [@elementsbot](https://forums.realmacsoftware.com/u/elementsbot)\
**Post date:** [June 18, 2025, 8:49pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/8 "2025-06-18T20:49:39Z")

</div>

To deploy these code examples in an Elements text component, follow these steps:

1. **Add a Text Component** :

2. **Insert the HTML and JavaScript** :

3. **Preview & Test** :

4. **Styling with Tailwind** (Optional):

By leveraging the powerful and intuitive Elements interface, incorporating JavaScript for email obfuscation becomes a seamless process, enhancing both the security and functionality of your website! Feel free to ask if you have any more questions.

---

<div class="post-metadata">

**Author:** ![handshaper](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/handshaper/32/27373_2.png) [@handshaper](https://forums.realmacsoftware.com/u/handshaper)\
**Post date:** [June 18, 2025, 8:57pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/9 "2025-06-18T20:57:06Z")

</div>

@dan I thought it would be a good test of the bot, but I’m not sure what it is suggesting will work in a text component as you cannot paste HTML in one and have it work.

Will see if there is a way to make this work with a custom component.

---

<div class="post-metadata">

**Author:** ![elementsbot](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/elementsbot/32/33134_2.png) [@elementsbot](https://forums.realmacsoftware.com/u/elementsbot)\
**Post date:** [June 18, 2025, 8:57pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/10 "2025-06-18T20:57:11Z")

</div>

It seems Bruce is experiencing an issue with implementing email obfuscation using Elements due to limitations in pasting HTML directly into a text component. Let’s clarify how you might achieve this with a Custom Component instead.

Here’s how you can take advantage of the flexibility offered by Elements:

1. **Create a Custom Component** :

2. **Insert HTML and JavaScript** :

3. **Save and Deploy** :

4. **Using Tailwind for Styling** :

This approach should help in integrating JavaScript email obfuscation effectively within Elements. If you need to explore more details on creating Custom Components in Elements, the official documentation from [Elements Docs](https://docs.realmacsoftware.com/elements-docs) can be a useful guide.

If you have any further questions or if anyone else wants to explore specific capabilities of Elements, feel free to ask! 🙌

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [June 18, 2025, 9:04pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/11 "2025-06-18T21:04:54Z")

</div>

Yeah, I’m not sure @elementsbot quite has the knowledge yet, especially as the manual still isn’t finished. He’ll definitely get better over time.

I did a quick test, and you can set an ID on a text selection I(n a text component), so I highlighted the text I wanted as the email address and applied the ID ‘contact-email’. This seemed to work just fine. I added the required Javascript to a Custom Component.

[https://share.cleanshot.com/pqnMwFlk](https://share.cleanshot.com/pqnMwFlk)

Although I’m honestly not sure how secure that really is, especially since AI can easily read and scrape web pages. A contact form is still the best way to go imho.

---

<div class="post-metadata">

**Author:** ![elementsbot](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/elementsbot/32/33134_2.png) [@elementsbot](https://forums.realmacsoftware.com/u/elementsbot)\
**Post date:** [June 18, 2025, 9:05pm UTC](https://forums.realmacsoftware.com/t/is-it-still-bad-to-place-my-email-address-and-phone-as-text-on-my-site/48134/12 "2025-06-18T21:05:01Z")

</div>

Here’s a summary of the discussion so far, and some guidance on how to handle email obfuscation using Elements:

### Discussion Summary

- **Protection Concerns** : Displaying an email address openly on a site can lead to spam. Various methods like contact forms and JavaScript obfuscation were suggested as protective measures.
- **Implementation Challenges** : Bruce faced challenges using Elements’ text component due to limitations in pasting HTML.
- **Custom Component Solution** : Creating a custom component within Elements allows more complex HTML and JavaScript, addressing those limitations.
- **Dan’s Experiment** : Dan mentioned successfully using an ID on text within a text component and adding JavaScript in a custom component.

### Recommendations

1. **Use a Contact Form** : This is the most secure way to avoid exposing your email address while enabling user interaction.

2. **JavaScript Obfuscation** : If you choose to display an email dynamically:

3. **Advanced Approach (Dan’s Input)**:

4. **Refer to Elements Documentation** : [Elements Docs](https://docs.realmacsoftware.com/elements-docs) can be valuable for detailed steps on custom components.

5. **Regular Updates** : Keep abreast of new Elements features via their [YouTube Channel](https://www.youtube.com/c/realmacsoftware) for the latest tips and best practices.

It’s clear that while Elements allows flexibility with Custom Components, always weigh the benefit of obfuscation methods against potential vulnerabilities. A contact form remains the superior solution for mitigating spam risks.
