WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Email Encoder Bundle - Protect Email Address

Encode mailto links, email addresses, phone numbers and any text to hide them from (spam)bots. Mailto links will be protected automatically after acti

How do I encode my email address(es)?

In the posts you can use this shortcode:

[eeb_email email="myname@test.nl" display="My Email"]

But mailto links will be encoded automatically (option is on by default):

<a href="mailto:myname@test.nl">My Email</a>

The source of the page will now contain encoded script, like:

<script type="text/javascript">/*<![CDATA[*/ML="mo@k<insc:r.y=-Ehe a\">f/lMt";MI="4CB8HC77=D0C5HJ1>H563DB@:AF=D0C5HJ190<6C0A2JA7J;6HDBBJ5JHA=DI<B?0C5HDEI<B?0C5H4GCE";OT="";for(j=0;j<MI.length;j++){OT+=ML.charAt(MI.charCodeAt(j)-48);}document.write(OT);/*]]>*/</script><noscript>*protected email*</noscript>

This code is not readable by spambots and protects your email address.

How do I encode phone nummbers or other text?

Just use the following shortcode within your posts:

[eeb_content]35-01235-468113[/eeb_content]

For other parts of your site you can use the template function eeb_content().

Email address in a form field is being encoded in a strange way. What to do?

An email address in a form field will not be encoded correctly. There are 2 ways to solve this problem:

  1. Turn of the option "Replace plain email addresses to protected mailto links". Keep in mind that this will be the case for the whole site.
  2. Add the page ID of the form to the option "Do not apply Auto-Protect on posts with ID". The page content will be skipped by the plugin.

How to use email encodig in Custom Fields?

You will have to use the template function eeb_email() or eeb_content(). For example, if your template contains:

echo get_post_meta($post->ID, 'emailaddress', true);

Then change it to:

$emailaddress = get_post_meta($post->ID, 'emailaddress', true);
echo eeb_email($emailaddress, 'Mail Me');

How to create mailto links that opens in a new window?

You could add extra params to the mailto link and add target='_blank' for opening them in a new window, like:

[eeb_email email="yourmail@test.nl" display="My Mail" extra_attrs="target='_blank'"]

In html this will look like:

<a href="mailto:yourmail@test.nl" target="_blank">My Mail</a>

How can I encode content of BBPress, WP e-Commerce or other plugins?

If you use other plugins that needs to be encoded you can add a callback to the action "init_email_encoder_bundle". For Example:

add_action('eeb_ready', 'extra_encode_filters');

function extra_encode_filters($filter_callback) {
    // add filters for BBPress
    add_filter('bbp_get_reply_content', $filter_callback);
    add_filter('bbp_get_topic_content', $filter_callback);
}

Can I use special characters (like Chinese)?

It's only possible to use special characters for the display. And only works by using the shortcode with the HTML encode method. Example:

[eeb_email method="enc_html" email="myname@myemail.nl" display="我的郵箱"]

How to encode emails in all widgets (and not only text widgets)?

If the option 'All text widgets' is activated, only text widgets will be filtered for encoding. It's possible to filter all widgets by using the Widget Logic plugin and activate the 'widget_content' filter.

Do you have another question? Please ask me

Requires: 3.4.0 or higher
Compatible up to: 3.9.1
Last Updated: 2014-6-15
Downloads: 43,036

Ratings

4 stars
4.7 out of 5 stars

Support

0 of 4 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

2 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1
100,3,3 100,2,2 100,2,2
100,2,2
50,2,1
100,2,2
71,7,5
100,4,4
100,3,3
100,1,1
100,2,2
100,1,1
0,1,0 100,1,1 50,2,1
50,2,1 50,2,1 100,1,1 100,2,2
100,1,1
100,1,1 100,1,1 100,2,2
100,5,5 100,1,1
100,2,2