Title: [Plugin: Email Address Encoder] Encoding e-mails from custom fields
Last modified: August 20, 2016

---

# [Plugin: Email Address Encoder] Encoding e-mails from custom fields

 *  Resolved [Miood](https://wordpress.org/support/users/miood/)
 * (@miood)
 * [14 years ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/)
 * Hi,
    I use “Advanced Custom Fields” plugin to show email addresses on posts but“
   Simple Mail Address Encoder” seems to not work with that adresses. Is it possible
   to make it works?
 * [http://wordpress.org/extend/plugins/email-address-encoder/](http://wordpress.org/extend/plugins/email-address-encoder/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [14 years ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2739868)
 * Sure, just read the FAQ section: [“How can I filter other parts of my site?”](http://wordpress.org/extend/plugins/email-address-encoder/faq/)
 *  Thread Starter [Miood](https://wordpress.org/support/users/miood/)
 * (@miood)
 * [14 years ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2739892)
 * Thank you for reply, but can you tell me precisely what should I do? I’m not 
   a coder and this is why i just need more complex solution, than the right direction
   🙂
 * The code in single.php:
    `<p><a href="mailto: <?php the_field('mail'); ?>"target
   ="_blank"><?php the_field('mail'); ?></a></p>`
 * How to use eae_encode_emails function to filter this?
    Thanks for help.
 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [14 years ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2739931)
 * That should do it:
 * `<p><a href="<?php echo eae_encode_str('mailto:'.get_field('mail')); ?>"><?php
   echo eae_encode_str(get_field('mail')); ?></a></p>`
 *  Thread Starter [Miood](https://wordpress.org/support/users/miood/)
 * (@miood)
 * [14 years ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2739950)
 * Thank you, works great!
 *  [captainbr](https://wordpress.org/support/users/captainbr/)
 * (@captainbr)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2740120)
 * I also have Advanced Custom Fields installed.
 * In Simple.php I replaced
    `<a href="mailto:<?php echo $email; ?>"><?php echo 
   $email; ?></a> <br />` with `<p><a href="<?php echo eae_encode_str('mailto:'.
   get_field('mail')); ?>"><?php echo eae_encode_str(get_field('mail')); ?></a></
   p>` and it is not encoding the address.
 * The page is [http://sidneybcdirectory.com/hagens-computers/](http://sidneybcdirectory.com/hagens-computers/)
 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2740121)
 * Your code seems to use your own $email variable, try this:
 * `<a href="<?php echo eae_encode_str( 'mailto:' . $email ); ?>"><?php echo eae_encode_str(
   $email ); ?></a>`
 *  [captainbr](https://wordpress.org/support/users/captainbr/)
 * (@captainbr)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2740122)
 * Thanks for the quick response. I inserted your code and I can still see plain
   text when I view the source.
 * Here is my code`<p><a href="<?php echo eae_encode_str( 'mailto:' . $email ); ?
   >"><?php echo eae_encode_str( $email ); ?></a></p> <br />`
 * Should the extra spaces be present?
 * Thanks for your help.
 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2740123)
 * The extra spaces are just easier to read.
 * If you call the function `eae_encode_str()` you output will be encoded for sure.
   Maybe you site is cached?
 * You cannot use Firebug, Web Inspector or Dragonfly, to test the encoding, because
   they decode decimal/hexadecimal entities into plain text. To make sure your email
   address is encoded, right-click/secondary-click the page, click “View Source”,“
   View Page Source” or “Source” and search for any plain text email addresses.
 *  [captainbr](https://wordpress.org/support/users/captainbr/)
 * (@captainbr)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2740124)
 * Hi Till, I am not using any caching as far as I know. I have refreshed the page
   and also used F5.
 * I have looked on my site on another computer which has never viewed the site.
   I am using View Page Source and the plain text is still visible.
 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2740125)
 * Well, then the only reason I can come up with is that you’re editing the wrong
   file, because everything that gets passed through `eae_encode_str()` will be 
   encoded. Sure you’re editing the right file?

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘[Plugin: Email Address Encoder] Encoding e-mails from custom fields’ 
is closed to new replies.

 * ![](https://ps.w.org/email-address-encoder/assets/icon-256x256.jpg?rev=970206)
 * [Email Address Encoder](https://wordpress.org/plugins/email-address-encoder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/email-address-encoder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/email-address-encoder/)
 * [Active Topics](https://wordpress.org/support/plugin/email-address-encoder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/email-address-encoder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/email-address-encoder/reviews/)

 * 10 replies
 * 3 participants
 * Last reply from: [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-email-address-encoder-encoding-e-mails-from-custom-fields/#post-2740125)
 * Status: resolved