How To Use JavaScript For Cloaking Email Addresses In WordPress ?

Now you can very easily enable JavaScript for cloaking email addresses present in your WordPress site content like posts, pages, CPTs and other shortcode supported areas including text and black studio widgets.

You can do this by using new WordPress plugin called Email JavaScript Cloak. Simply install and activate it. After activation the plugin enables a shortcode for automatically generating cloaked email addresses inside your content.

How To Use Cloaking JavaScript Shortcode ?

After Email JavaScript Cloak plugin is activated use [email youremail@domain.com] for displaying cloaked email addresses. Your email address will appear “yourmail -at- domain -dot- com” inside your content but this shortcode runs JavaScript in the browser and your simple email address text gets converted into a regular clickable email link.

The idea is simple: most automated ‘scrapers’ or ‘harvesters’ don’t run JavaScript and hence they won’t be able to pick this non-standard email address. Vast majority of users visiting your site have JavaScript and will be seeing this regular email address not its strange format.

In-case the users visiting your website who don’t have JavaScript enabled will see your email address in (“yourmail -at- domain -dot- com”). Also if you want to cater this tiny minority of users then you can include a footnote using custom shortcode [emailnojs] which explains this email’s strange format.

Leave a Reply