We don’t want users posting emails. Is there a way to achieve this?
Thanks!!
The discussion revolves around automatically censoring email addresses on posts. rodrigofarcas initiated the conversation, seeking a solution to prevent users from posting emails on their Pets site. eviltrout suggested enforcing a site rule and relying on moderators to remove emails, while pfaffman provided a regular expression pattern to censor emails.
However, users encountered issues with implementing the pattern due to character limits and errors. ashledombos pointed out that the previously accepted 426-character email regex pattern is no longer allowed due to the 50-character limit. codinghorror mentioned that the limit was increased to 100 characters, but Simon_Manning raised concerns about the regular expression working only partially when the enable markdown linkify setting is enabled.
To enable regex for watched words, users need to navigate to / Admin/logs/watched words and toggle the watched words regular expressions setting, as Canapin explained.
We don’t want users posting emails. Is there a way to achieve this?
Thanks!!
We do have a censoring mechanism, but it’s based on words.
Your best bet would be to write your own plugin ![]()
Also could you just make it a site rule not to do that? And have moderators remove it if it happens?
We haven’t had a problem here with people posting many email addresses.
It’d also be a problem when allowing anonymous emails into the a new topic … the sending email address is posted above the incoming message.
yeah, it is a Pets site, and people start posting their emails about free dogs or cats, which are usually fake. We delete them manually, but still would be good to have an automatic rule for emails.
If you can teach your community to flag these posts as spam when they see them, I think you’ll be pleasantly surprised at how easy it becomes ![]()
censored pattern = \d{3}-\d{4}|[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+
will censor xxx-yyyy phone numbers and email addresses.
Does the above pattern work for anyone else? I tried entering it and got a “Sorry, an error has occurred.” alert. Even with just \d{3}-\d{4} and regular expressions turned on, it doesn’t block 123-1234 in a post. Was there a change, or am I doing something wrong? Thanks!
Where do I enter that?
It moved.
Navigate to /Admin/logs/watched words
I think you also need to enable the option regex for watched words in the settings.
Doesn´t aceept the expression, to long, error says maximum 50 signs. I tried to enter it in censuring
I’d like to express my support to anyone who could fix this “issue” too: previously the official RFC 5322 (426 characters) could be entered to hide any email address. Now it’s only 50 characaters max.
Maybe now there is another better way to obfuscate email addresses (especially to crawlers)?
I second the idea of increasing the character limit here. Regular expressions can easily get past 50 characters.
For the watch words, it would also be nice to have a description field so when there is a regular expression in there, it is easy to know what it should be doing.
Je pense que nous avons récemment augmenté la limite de 50 à 100 caractères ici. Quelqu’un se souvient-il de cela ?
Je ne sais pas si cela a changé depuis janvier, mais cela semble ne fonctionner qu’à moitié lorsque le paramètre « activer le lien markdown » est activé.
L’expression régulière fonctionne parfaitement pour censurer le texte, mais une adresse e-mail est d’abord analysée et convertie en un lien mailto, exposant ainsi l’adresse e-mail dans le HTML.
Par exemple :
<a href="mailto:someone@example.com">■■■■■■■■■■■■■■■■■■■</a>
Comment faire cela ? Je n’ai trouvé nulle part comment activer les expressions régulières – si j’essaie de les utiliser de toute façon, cela ne fonctionne pas.
Le nom du paramètre est expressions régulières de mots surveillés ![]()