Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

How does "twig safe_email" protect me?

Started by Smith 7 years ago · 1 replies · 1250 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 Jerry Hunt, 4 days ago
2 80 9 hours ago
General · by pamtbaau, 14 hours ago
1 51 13 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago