I am using WordPress comments on a page as a Contact page and I am able to show those comments only to logged in admin.

Now I would like to automatically have any comments placed on my Contact page approved. So, in the front end, I can see all comments placed on that page instead of seeing only the approved comments.

I would love to have a hook in functions.php that works with twenty eleven child theme.

  • Why don't you use a contact form plug-in, like Contact Form 7? Nov 17, 2012 at 20:34
  • Well I simply believe that if well use the comments function has everything needed and I just want to have the ability to have the contacts save for later. Nov 22, 2012 at 7:15

1 Answer 1


Considering that in Settings > Discussion you have this options checked:

comments moderation and whitelist options

The first is comment_moderation and the second comment_whitelist.

Then, it is possible to selectively disable them using the filter pre_option_(option-name), as follows:

add_filter( 'pre_option_comment_moderation', 'wpse_72990_auto_aprove_selective' );
add_filter( 'pre_option_comment_whitelist', 'wpse_72990_auto_aprove_selective' );

function wpse_72990_auto_aprove_selective( $option ) 
    global $post;
    if( $post->ID == 2 ) 
        return 0;

    return $option;
  • 1
    You save my day. Nov 22, 2012 at 7:18
  • Now my next idea is to separate comments of my contact page from other comments by displaying them through a wordpress theme options or at least putting a filter in comments page. Any suggestion is welcomed. Nov 22, 2012 at 7:21
  • Answered here: wordpress.stackexchange.com/a/72108/12615
    – brasofilo
    Nov 25, 2012 at 15:35

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