Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

How does "twig safe_email" protect me?

Started by Smith 7 years ago · 1 replies · 1627 views
7 years ago

I'm new to GRAV and relatively new to web dev in general too.
I've just seen this in the documentation and I'm wondering how does this work?
How does it protect me from spam bots?
And is this enough or should I combine it with other protection measures?

That is one of the less points in the documentation without a explanation. Maybe because its pretty obvious for you, but not for me. ;)

7 years ago

If we open our hymnals to an earlier page, we find a better description of the filter: https://learn.getgrav.org/16/themes/twig-filters-functions#safe-email. Specifically: {{ "[email protected]"|safe_email }} yields someone@domain.com. For naive bots, that scour the net for public e-mail addresses, this will not be picked up. If you want to protect it further, you'll probably want to use a contact form.

Suggested topics

Topic Participants Replies Views Activity
General · by themetman, 23 hours ago
2 40 16 hours ago
General · by Hanns Mattes, 1 week ago
0 121 1 week ago
General · by Karmalakas, 1 week ago
2 185 1 week ago
General · by Hanns Mattes, 3 weeks ago
0 235 3 weeks ago
General · by Dima, 4 weeks ago
1 211 4 weeks ago