WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to put a link in the post meta with this code

$authorEmail = get_the_author_meta('user_email');
$authorEmailLink = '<a href ="mailto:'.$authorEmail.'">'.$authorEmail.'</a>';
add_post_meta($post->ID,'Author Email',$authorEmailLink,true);

The $authorEmailLink is a valid link because I can echo it to the page. However, when I put it on the page, it just displays the plain text email. Is there something I am not doing or a way to get around this?

share|improve this question
up vote 1 down vote accepted

I don't think spaces are allowed in $meta_key. Try to change 'Author Email' to 'author_email'.

Also, if you don't want 'author_email' to be visible in Custom Fields metabox, prepend it with underscore: '_author_email'. Unfiltered link as custom field value can also mess this metabox.

share|improve this answer
Thanks for your help, Max. – fdsa Jun 20 '12 at 20:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.