Summary: Unobtrusive e-mail link (de)obfuscator
Version: 20120717
Status: Beta
Maintainer: Petko
Discussion: DeObMail-Talk

Users: +7

License: GPL2+

Note: A feature based on this recipe will be included in PmWiki 2.2.119, and can be enabled in config.php with:
$LinkFunctions['mailto:'] = 'ObfuscateLinkIMap';
If you enable the core feature, please disable the current recipe.


This recipe renders e-mail links unreadable for spambots but usable for humans.

  • E-mail links are written as usual in the Wiki source.
  • E-mail links are obfuscated in the HTML output and meaningless for spambots.
  • A small JavaScript instructs browsers how to de-obfuscate the e-mail addresses, and to display clickable links to the visitors.
  • Human users with JavaScript disabled should be able to figure out the addresses.

This recipe is now installed on



Just write your e-mail links like you usually do:

* [[]]
* [[ | e-mail me! ]]
* [["Tooltip title" | with a tooltip ]]
* [[ e-mail | with ?subject= ]]
* [[email me -> ]]
  • example [snail] example [period] com
  • example [snail] example [period] com
  • e-mail me! -> mailto:example [snail] example [period] com
  • with a tooltip -> mailto:example [snail] example [period] com
  • with ?subject= -> mailto:example [snail] example [period] com?subject=Wiki e-mail
  • email me -> mailto:example [snail] example [period] com

Demo page.


The e-mail addresses are converted to a special format: becomes example [snail] example [period] com. (This format is only visible to bots and to users with JavaScript disabled.)

You can change the [snail] and the [period] parts by adding to local/config.php the following:

 $DeObMail['@'] = ' [arobase] '; # ie translated to French
 $DeObMail['.'] = ' [point] ';

Advanced admins can change the format of the HTML link snippet, by adding to local/config.php something like this:

  $DeObMail['LinkFmt'] = '<a href="%u" class="mail" target="_blank">%t</a>';

where %u will be replaced with the e-mail address, and %t with the link text.


  • Your skin needs the standard marker <!--HTMLFooter--> near the bottom of the skin.tmpl template file, right before </body></html>.
  • Emails in the wiki source are not obfuscated, so this recipe is mostly useful for wikis that have at least some password protection. Both "edit" and "source" actions should be protected.
  • Only mailto: links are protected, plain text "" in a wiki page is not a link and will be visible.

Release notes

  • 20120717 - add $DeObMail['LinkFmt'].
  • 20111024 - minor usability improvement for readers with JavaScript disabled: when the link address is the same as the link text, it will not be repeated.
  • 20090824 - add $DeObCustom variable.
  • 20090703 - first public release.

See also

The following recipes were created with the same goal as DeObMail, but may fail to reliably protect all types of e-mail links, or may be unusable by visitors with JavaScript disabled.

Cookbook /
EProtect  Email obfuscation
ObfuscateEmail  Prevent email addresses from being harvested from your site (do not use, does not protect)
ProtectEmail  Email obfuscation


  • This recipe is written and maintained by Petko (5ko [snail] 5ko [period] fr).
  • If this recipe helps you or saves you time, you can help support its continued development by .


Your comments are welcome at DeObMail-Talk.

User notes +7: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.