Content last modified Monday 6 March 2017
hop to #bottom
Current version:
About It:
Get it:
Rate it:
  • Helpful?
  • 1 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!


This is a drop-in replacement for the txp:email tag which attempts to provide a more robust block against spam harvesters. It can generate both a Javascript-based encoder which can only be “cracked” by a harvester that runs Javascript and a somewhat more sophisticated entity encoder that will first convert an address from “” form to “foo at bar dot com” and then encode with a mix of decimal and hex entities. (This is less convenient due to the slight “mangling” of the address.)

<txp:wm_encode email="" linktext="email me" title="popup" />

In addition, there are script and noscript attributes to control generation of the Javascript-based and text-based encoding blocks, respectively. Use script="0" to not generate the Javascript block and script="1" to generate it, and noscript="0" and noscript="1" for the text block.

By default, only the Javascript block is generated. The default settings are marked with comments in the function and can be changed. If both blocks are generated, the text block will be wrapped in <noscript> tags, so Javascript-enabled browsers will only see the first one. If only the text block is generated, it will not be wrapped in <noscript>.

Download g1.19 version
Download 1.0rc version

Article Request Count:
Posted here:
22 Mar 2005
Article modified:
22 Mar 2005

If there is a comment form at the Information URL, you may want to leave your comments/questions there for quicker feedback. Otherwise, comment away:

Commenting is closed for this article.

Commented (2)

Hi, thanks for this plug-in.
I’ve added/changed a feature, so that if the noscript option is set to 0, the noscript appears, but only with a warning notice:
[please enable JavaScript to view email]

Code following the noscript if bracket:

if ($script) $out .= “”;
$out .= $linktext.’ [please enable JavaScript to view email]’;
if ($script) $out .= “”;
Is there a way to do the same thing for the email address that is written when someone writes a comment?

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern