Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 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;    
}
share|improve this answer

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

share|improve this answer

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 .

share|improve this answer
    
Reupvoted. It's not the best advice, but it also works. –  kaiser Jul 29 '12 at 12:48

protected by toscho Nov 21 '12 at 8:14

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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