How to Remove The Website URL Field From The WordPress Comments Form

I was trying to google this and I found a few links to blogs that didn’t explain it right or were wrong all together, so I looked into it myself and decided to share the solution with all of you who want to remove the URL field (also called Website field) from your WordPress posts comment sections at the bottom of each post page. This may not be the most elegant solution, but it’s simple and does the job. It’s rather simple – we will do it in 3 steps. Here is how:

I will assume you have an FTP access to your website files. If you use other means to access the files, that should work just as well.

1. Connect to your server and go to the directory that contains your WordPress files. There, you should find a directory called wp-includes. Go inside the  directory and find a file called comment-template.php.

2. Copy the file comment-template.php to your computer and open it with your favorite text editor. You’ll see a lot of PHP script in the file. Find the lines containing:

$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>',
        );

and edit the lines to look like this (you essentially remove the two lines starting with ‘url’:

$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>',
        );

Save the modified file and if you downloaded it to your computer prior to editing it, upload it back and overwrite the old version.

3. Disconnect from your server, open your browser, go to some of your posts on your blog site and try to post a comment. The Website field should be gone. You should a comment form without the Website field – something like this:

Wordpress Website Field Removed

I hope you’ll find this helpful!

Bookmark the permalink.