Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

How does "twig safe_email" protect me?

Started by Smith 7 years ago · 1 replies · 1479 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 Andy Miller, 6 days ago
0 106 6 days ago
General · by lynbor, 4 weeks ago
3 436 2 weeks ago
General · by lynbor, 3 weeks ago
7 555 2 weeks ago
General · by Harry, 2 weeks ago
0 159 2 weeks ago
General · by Old Man Umby, 1 month ago
2 308 3 weeks ago