1

I' would like to remove the "site"-inputfield in the comment form in Wordpress twenty eleven. Someone who knows the answer? Thanks in advance.

3

you can try adding this filter to your theme's functions.php:

add_filter('comment_form_default_fields', 'remove_url');
function remove_url($val) {
    $val['url'] = '';
    return $val;    
}
2

To remove any field you should pass the $args of which fields you want to be showed in your form.

Exemple:

<?php
    $args = array(
        'fields' =>array(
            'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
            'email' => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
            // 'url' => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label>' . '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
        ); 
    );
    comment_form($args);

You just have to comment the line of the Website, and pass the array like in the exemple.

If you want further reading on how to customize your form with the function comment_form(); you should read this Codex page

0

Go to wp-content\themes\suffusion\comments.php file

suffusion is my theme name , you should go to your respective theme folder

find this block of code

comment_form(apply_filters('suffusion_comment_form_fields', array(
        'fields' => array(
            'author' => $author_field,
            'email' => $email_field,
        //  'url' => $url_field,  // comment this field 
        ), 

and just comment the url field .

1
  • Reupvoted. It's not the best advice, but it also works. – kaiser Jul 29 '12 at 12:48

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