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

Is there any way that I can have a website user be able to contact a post author. The website user must not be required to be logged in to the website. I guess a form to email the post author might be the way to go, but it must be simple to use, and avoid spam. Is there such a plugin for wordpress that can handle this?

share|improve this question
Contact Form 7 or Gravity Forms is the way to go, a couple of simple hooks pulled at the correct time and it will be routed to the $post->post_author's email. – soulseekah Mar 23 '12 at 14:05
up vote 2 down vote accepted

Ive done this before using both contact form 7 and Grunion Contact Form plugins, when using contact form 7 i created a new tag to send the email to the post author:

//contact form 7 author email
wpcf7_add_shortcode('author_email', 'wpcf7_expert_email_shortcode_handler', true);

function wpcf7_expert_email_shortcode_handler($tag) {
    if (!is_array($tag)) return '';

    $name = $tag['name'];
    if (empty($name)) return '';
    global $post;
    //get author email:
    $author_mail = get_the_author_meta('user_email',$post->post_author);
    $html = '<input type="hidden" name="' . $name . '" value="' . $author_mail . '" />';
    return $html;

* Usage: in contact form 7 form area add
* [author_email unique_name]
* and in to email address add
* [unique_name]

and with Grunion i called it directly from the template using:

global $post;
$author_mail = get_the_author_meta('user_email',$post->post_author);
echo do_shortcode('[contact-form subject="message from.'$post->post_title.'" to="'.$author_mail.'"]');
share|improve this answer
Thanks Bainternet! – robgt Mar 30 '12 at 12:56

I've been using the Grunion Contact Form for this. Works like a charm. Ties into Akismet for spam filtering. It's very simple to use--you can insert a shortcode into your post content, or insert a "do shortcode" function into your template. Works either way.

share|improve this answer
Thanks Adam! I've accepted Bainternet's answer purely as it also included the required code to achieve the objective. Many thanks to you both! – robgt Mar 30 '12 at 12:56

Contact Form 7 can do this without any coding. When you create the contact form, use the special mail tag [_post_author_email] as the "To" value in the Mail tab. Then place the contact form shortcode in a post, and emails should go to the post author's email address. I just tested it with Contact Form 7 v4.3.1 and it seems to work correctly.

share|improve this answer

Use WordPress Comments without displaying them on the site. The Author will be notified, the comments can be managed well and there are built-in functions and plugins to help with spam.

share|improve this answer

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.