WP Mailto Links Plugin – Protecting Email Links in WordPress

Hello, welcome to this introduction of the WP Mailto Links Plugin. With this plugin you can protect all email addresses and email links on your website.

Why do you need to protect them?

Well there are lots of spambots scanning the internet looking for email addresses. They collect them and use them for spamming purpuses. So when you have email addresses on your WordPress site and want to protect them from these spambots, you could for example use this plugin.

How does it work?

When you have an email link on your site, like this, the code behind it will look like this. This is the html code. The browser can read the HTML code and shows the page.

The code of the email link contains the email address, even twice. When the Mailto Links plugin is activated, this code will be replaced by this code. It’s a little longer, but you cannot see the email address anymore. It’s completely obfuscated.
And that’s how the email addresses will be encrypted and protected from spambots.

Plugin Features

  • Protect mailto links automatically
  • Protect plain email addresses or convert them to mailto links
  • Protect RSS feed
  • Set icon for all mailto links, also supports Font Awesome Icons and Dashicons
  • Use of shortcode [wpml_mailto]
  • Use of template tags wpml_mailto() and wpml_filter()

The plugin combines the best email protection methods (css and javascript techniques).

Easy to use

The WPML plugin works out-of-the-box. After activating the plugin all options are already set for protecting your emails and mailto links. Optionally you can also set some style options, like adding an icon.


  • PHP version 5.3 or up
  • WordPress version 3.8 or up


  • C0BALT 8 April 2011 Reply

    I have narrowed a problem down to your plugin.

    When I submit a form which redirects to “blog page” for example, only a white screen is shown (no html at all) after submit and stops reloading.

    Oh, Version .1 worked fine. Very odd. I hope this is useful information? Email me if you want more specific info, and or let me know if you want specific debugging info. I would need to get an idea of how to set the debugging you want.

  • C0BALT 8 April 2011 Reply

    OK, back again… I went through the code to look for differences between .1 and .2 and thought that I would try this.

    Options have effect on
    +All contents the whole
    -Post contents
    -Text widgets

    IF I have “All contents the…” selected, it hangs on form submission on the redirect.

    IF the other three are selected instead, everything works like normal.

    • Victor 8 April 2011 Reply

      @Cobalt I will mail you to get more details.

  • David 8 April 2011 Reply

    I found what a few problems:

    1) If “No icon” is selected, then the link text is displayed backwards. It doesn’t seem to use the .rtl class. I uncommented line 348 of wp-mailto-links.php to fix this.

    2) The email address is encoded into rot13, but then not decoded.

    3. Email addresses that are Dan Smith are truncated to be an Smith.

    I would send you a link to look at the code, but I’m working locally unfortunately.

  • David 8 April 2011 Reply

    A quick follow up:

    Regarding 2), I now realize that the link gets decoded once it’s clicked. I would suggest that you create a new setting to allow for decoded rot13 links on page load. I presume this is less secure, but I prefer to copy and paste mailto links, rather than click on them.

    Regarding 3), it looks like my example code got auto-mangled by WordPress, but you hopefully understand the problem. Any {a}Dan Smith{/a} or {a}Kim Smith{/a} text gets truncated to an Smith and im Smith, respectively.

  • Wp3-Beginner 3 August 2011 Reply

    This link

    {a hXef=”maXlto:partnerATxxx-company.com?subject=XXX-Partner”}partnerATxxx-company.com{/a}

    gets messed up by the plugin, can you check?

    Again due to messed up post.

    Replace AT with email-a.

  • Kellan 14 December 2011 Reply

    Your plugin, which I appreciate, seems to break WP 3.3, which was just released.

    When updating pages or posts, after hitting ‘update’ the page refreshes to a blank page.

    I also received this error a few times:
    Warning: Cannot modify header information – headers already sent by (output started at /home/bitsnbla/public_html/dev2/wp-includes/general-template.php:2101) in /home/bitsnbla/public_html/dev2/wp-includes/pluggable.php on line 866

    I deactivated all other plugins, and this occurs only when WP Mailto Links is activated.


  • Harald 15 December 2011 Reply

    White screen of death!! :p

    Figured it out after three hours. ;-p

    I love this plugin and it would be great if you could fix it. 🙂

  • Craig Fox 21 December 2011 Reply

    I recently upgraded to wp3.3. It was not trouble free. One of the problems I found was with your plugin. It wreaks havoc on the admin page. I think it has to do with how the plugin add itself to the Settings tab on the admin bar. It prevents the windows from laying out properly (the content pane loads below the right side tool bar) and when the tool bar is maximized (not icons) it distorts the layout by using 3x space.

  • Fred 4 January 2012 Reply

    I too have got the WSOD… only figured it out over the Festive season and agree with Kellan, it has only happened since 3.3!

    Do you have any solution as I love the plugin functionality!

  • Mike Berg 5 January 2012 Reply

    I also am getting this “white screen” when creating new posts or updating posts. The site was just updated to 3.3.1. Deactivating the plugin solves the problem.

  • Kieran 5 January 2012 Reply

    Same Here on 3.3! blank Screen.

    A rough solution which worked for me was. Warning I have not have any issues since, but it is risky and I am not sure what that file does. Might do you until the update is released.

    goto the wordpress directory



    Comment out line 2101.

  • emiliano 6 January 2012 Reply

    same problem here with wp 3.3.1
    gets me white screens, unable to edit images, (like crop), and when uploading new post gets stucked..

    if you could figure out whats the issue i would be very thankful, as its a really helpful plugin


  • Eric 10 January 2012 Reply

    Same here, white screen but not on all pages, single post pages are fine but the category page is not. I’m using excerpts + plugin for Headway so maybe there is some incompatibility there.

    • Victor 11 January 2012 Reply

      Sorry for the late response. I will look at it this week. To be continued…

  • anna-karina 13 January 2012 Reply

    same problem here with wp 3.3.1 (dutch)

    Cannot modify header information – headers already sent by …. public_html/wp-includes/pluggable.php on line 866

  • Coen 24 January 2012 Reply

    Same here. 3.3.1 gives headers already sent error. You said you would look at it “this week”. In the meantime we are already almost 2 weeks later…

    • Victor 30 January 2012 Reply

      New release v0.24 solves the blank page issue and the layout problem in Internet Explorer.

      I didn’t get the warning “Cannot modify header information” (also tested in older versions of WP). So please let me know if it still occurs.

  • bravely 12 March 2012 Reply

    I love this plugin and it works great except for one thing.

    On my admin screen, I can no longer collapse or expand my blocks when writing a page. I have narrowed the problem down to this plugin.

    I have not tried other admin areas, but I disabled it when I noticed this on the write page blocks.

    i.e. the page attributes block (and all other blocks) will not collapse or expand from whatever state it’s in when the page is opened.

  • Alexander Bailey 7 May 2012 Reply

    Hi Victor,

    I’m having an issue with plain emails: if a period follows immediately after a plain email, the mailto link produced by the plugin will include the unwanted period. For example, the following sentence:
    Send an email to me@mydomain.com.

    Will result in this link:

    Other than this, I love this plugin.

  • Alexander Bailey 7 May 2012 Reply

    Wouldn’t you know it? Your site parsed my example email address correctly, and kept the unwanted period out of the encoded link. I’m banging my head against the wall here; maybe there’s some conflict with my WP theme?

    • Victor 12 May 2012 Reply

      This site uses the Email Encoder Bundle plugin for encoding emails 🙂

      Maybe this issue will be fixed, but for now you can use a workaround by creating a real mailto link and put a dot after closing the link, f.e.:
      <a href="mailto:me@mydomain.com">me@mydomain.com</a>.
      The plugin will encode the mailto link.

  • Frederic Ch. Reuter 11 August 2012 Reply

    If you working on an internationalized update, please could you send me your Plugin-Release and i can support you by a german .po- and .mo- File

    Great Job, nice solved – my respect and congrats to you 😉

  • Mike 5 December 2012 Reply

    Great Plugin, but I have the Problem that the Adress (example) name@it.university-koeln.de didn´t work!
    The link ends after the word univerity.

    Any ideas?

  • Adrian Walmsley 18 March 2013 Reply

    When I upgraded to WP-Mailto 1.0 the email addresses on the page above were not recognised and converted to javascript protected links.
    So I had to go back to Version 0.30

    • Victor 21 March 2013 Reply

      @Frederik: Yes I will. Thanks for the offer.

      @Mike: That’s beacause of the – sign. Will be fixed in next bugfix release.

      @Adrian: Can you send me the email address that wasn’t recognized?

  • James 21 March 2013 Reply

    After upgrading to WordPress 3.5.1, this plugin caused a “White Screen of Death” for the “All Pages” and “All Posts” pages in wp-admin.

    • Victor 22 March 2013 Reply

      @James: Please upgrade plugin to version 1.0.1

  • Adrian Walmsley 26 March 2013 Reply

    My previous problem was cured by Version 1.0.1 – thank you.

    Everything is fine except there seems to be a conflict with the “Sign up for eMail updates” widget that comes with the Jetpack plugin.
    I’ve got it working by unchecking
    Options have effect on .. all text widgets.

    If you visit http://compton.parish.hants.gov.uk/ and scroll down you will see the Jetpack widget which writes webmaster@compton.parish.hants.gov.uk into the text input field.

    Before I unchecked that option, javascript code was appearing below the text input box.

    Many thanks

    • Victor 17 December 2013 Reply

      @Adrian: Sorry for the late response. Yes this is a known bug and it’s on the TODO list.

  • Jessica 11 January 2014 Reply


    I recently updated the WP Mailto Link plugin to Version 1.2.1 and my site became unresponsive – I don’t know why. I would like to go back to the previous version. Is there anyway that I can download an old version? Unfortunately I didn’t back up before updating.


  • Jessica 11 January 2014 Reply

    Nevermind I had a back up. Please disregard. But also keep in mind that your update is not compatible with my site now :-/ I do not know why.

  • Jasper 11 January 2014 Reply

    Just updated to 1.2.1 as well but plugin won’t activate:

    Warning: require_once(/includes/class-admin-wp-mailto-links.php) [function.require-once]: failed to open stream: No such file or directory in /home/deb66391/domains/openhof.com/public_html/wp-content/plugins/wp-mailto-links/wp-mailto-links.php on line 18

    Fatal error: require_once() [function.require]: Failed opening required ‘/includes/class-admin-wp-mailto-links.php’ (include_path=’.:/usr/local/lib/php’) in /home/deb66391/domains/openhof.com/public_html/wp-content/plugins/wp-mailto-links/wp-mailto-links.php on line 18

  • Tom 12 January 2014 Reply

    I’ve the same problem as above…
    Ver. 1.2.0 is still OK.

  • Joosd 12 January 2014 Reply

    I have the same problem as Jasper:

    Warning: require_once(/includes/class-admin-wp-mailto-links.php) [function.require-once]: failed to open stream: No such file or directory in /home/Sites/Customers/www.joosd.nl/web/wp-content/plugins/wp-mailto-links/wp-mailto-links.php on line 18

    Fatal error: require_once() [function.require]: Failed opening required ‘/includes/class-admin-wp-mailto-links.php’ (include_path=’.:/usr/local/php-5.3.10-1/share/pear’) in /home/Sites/Customers/www.joosd.nl/web/wp-content/plugins/wp-mailto-links/wp-mailto-links.php on line 18

  • Reskator 12 January 2014 Reply

    It’s the same thing for me : fatal error…

    a beginner’s error on the file path 🙁

  • Tigerz 12 January 2014 Reply

    I have the same problem

  • kikibelux 12 January 2014 Reply

    I have the same error, I must desactivate the site !

    Warning: require_once(/includes/class-admin-wp-mailto-links.php) [function.require-once]: failed to open stream: No such file or directory in /home/randa658/public_html/prod/wp-content/plugins/wp-mailto-links/wp-mailto-links.php on line 18

    • Victor 13 January 2014 Reply

      This problem should be fixed in version 1.2.2.

      @Reskator: Indeed, it’s a beginners error. Unfortunatly the error didn’t occur on my test environment.

  • Reskator 14 January 2014 Reply

    Victor, there is many environments… This is why there are methods of programming to determine them.

    Thank you for this update.

  • kikibelux 14 January 2014 Reply


    all is right !

  • Nick 19 March 2014 Reply

    I’m using Event Organiser and the wp mailto links plugin. Any single event with an email address is echoing a block of content at the top of the page. It is also echoing the html tags in the copy.
    The copy in the_content area appears as it should.

    I also noticed that if I add a large amount of copy, the echo at the top will display a portion of the copy and end with “read more”.

    I’m also using WordPress SEO (yoast). With one or both of these plugins disabled the copy appears correctly.

    Any thought on how to resolve, without turning off these plugins? I’m not sure where to start with determining the source of the issue.

    Here is a sample… http://goo.gl/Cqm4oP

  • Peter Lowish 30 June 2014 Reply

    Loved your plugin to protect email addresses of people who have volunteered testimonials in the site

    A couple of issues though unfortunately relating to Gravity forms:
    1.. I upgraded gravity forms plugin to a new version, and could not get to wp-admin again
    2.. When someone fills out a form with their email address, the result is *protected email* in the form response, meaning the email address of the person filling out the form is not there

    Have had to turn it off, sorry


  • Cute Case 12 October 2014 Reply

    There is a problem with the last update (v1.4.0) : all checkboxes are checked by default !!!

    For example, if I view and update woocommerce settings, all checkbox are checked (even if I don’t check the box) when I update the settings => a big problem with the “Notice store” : my store is closed !!!

    Idem whith products (all checkbox are checked : virtual product, downloadable product, etc.).

    I have disable your extension, redefined the woocommerce settings and all is fine. Ouf !

    • Victor 15 October 2014 Reply

      I see you already updated to v1.4.1. Does it work OK now?

  • Shane Burdett 20 January 2017 Reply

    Do you freelance work? I need to convert the plaintext emails on my site to contact forms rater than mailto links.

Leave a Reply