Recommended method for email obfuscation?
-
I really want to display the organizer’s email but I also really want to protect the email from being harvested by spambots.
A simplistic way to do this is to add a filter for tribe_get_organizer_email that encodes the email characters as HTML entities. However, this is very weak protection and many spambots can bypass it easily.
The preferred way is to use JavaScript to construct the email address dynamically in the document. We have been doing this via a tribe_get_organizer_email filter and it has been working fine up until v4.2. However, with the new release, the event information is stored in the page inside a
<script type="application/ld+json">
tag. When the</script>
tag in our obfuscation code is encountered, that prematurely ends the enclosing<script>
and breaks everything.I am looking for a recommendation for how to use a script to obfuscate the organizer email. Or some other way to obfuscate that is not easily broken by spambots.
- The topic ‘Recommended method for email obfuscation?’ is closed to new replies.