Obfuscate your email address or other sensitive information with a shortcode to prevent spam and automated harvesting of data.
Obfuscate your email address or other sensitive information with a shortcode to prevent harvesting of your data.
Version 2.0 includes an improved way of displaying the email without relying on JavaScript document.write();
Usage
Basic usage
[email-obfuscate email=”[email protected]”]
Setting custom link text
[email-obfuscate email=”[email protected]” link_title=”Email Bob!”]
*Setting custom link title attribute”
[email-obfuscate email=”[email protected]” tag_title=”Email Bob!”]
Using every available setting (this example shows their default values)
[email-obfuscate email=”[email protected]” linkable=”1″ link_title=”” use_htmlentities=”1″ use_noscript_fallback=”1″ noscript_message=”Please enable JavaScript to see this field.”]
Usage from a template or plugin
Below is a snippet that you can use in any template or plugin to apply the same obfuscation to an email as using the shortcode:
if(function_exists(‘eos_obfuscate’))
{
echo eos_obfuscate(array(’email’ => $email, ‘link_title’ => ‘Email Bob!’));
}
else
{
echo $email;
}
If the plugin is not enabled, the email address will just pass through and output in cleartext.
email-obfuscate-shortcode
folder to /wp-content/plugins/
Email Obfuscate Shortcode converts your email address into JavaScript-based snippet. This makes the address unreadable to the vast majority
of email harvesting techniques.
Internet Explorer 6 and up, any Firefox, Chrome, Safari or Opera version.
To obfuscate phone numbers, names and other sensitive information, pass the parameter linkable=”0″. This will print anything you
put in the “email” field as text onto your page, fully protected.
People without JavaScript will see a placeholder message urging them to enable JavaScript. The current placeholder message reads:
“Please enable JavaScript to see this field.”
You can customize this message by passing the noscript_message=”” parameter to the shortcode.
This protection has been proven very effective. However it is theoretically possible to harvest the email address if you run a real browser that resolves javascript (Selenium, Mechanical Turk workers etc.)