BuddyDev

Search

[Resolved] Unset fields in WordPress Comment Form

Tagged: 

  • Participant
    Level: Enlightened
    Posts: 40
    Jessica Martin on #22572

    Hello,

    I hae used the following function in the past to remove the email and url fields in the comment form, but it is not working in the CB theme. How can I remove those fields?

    ‘function igmr_remove_comment_fields($fields) {
    unset($fields[‘url’]);
    unset($fields[’email’]);
    return $fields;
    }
    add_filter(‘comment_form_default_fields’,’igmr_remove_comment_fields’, 50 );’

  • Participant
    Level: Enlightened
    Posts: 40
    Jessica Martin on #22573
    function igmr_remove_comment_fields($fields) {
        unset($fields['url']);
        unset($fields['email']);
        return $fields;
    }
    add_filter('comment_form_default_fields','igmr_remove_comment_fields', 50 );
  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #22574

    Hi Jessica,
    Please change this

    
    add_filter('comment_form_default_fields','igmr_remove_comment_fields', 50 );
    

    to

    
    
    add_filter('comment_form_fields','igmr_remove_comment_fields', 50 );
    

    That will do it. Please make sure to uncheck the “Comment author must fill out name and email” in discussion settings to make the comments work.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 40
    Jessica Martin on #22744

    Thank you!

The topic ‘ [Resolved] Unset fields in WordPress Comment Form’ is closed to new replies.

This topic is: resolved