For my purposes, I did not see any real benefit from having users leave a website URL (it didn’t help that it was being used by spammers). I decided to remove the ‘Website’ field from the WordPress comment form. A quick search of the files through the Appearance editor didn’t yield anything obvious regarding where the fields were actually listed so a function must be called which pulls in the default comment fields. The function is located within one of WordPress’s core files and is named ‘comment_form’. Instead of modifying this function, I will first show you the best way to remove the website field.
We’re going to create a plugin to filter out the website field from the comments form. This is the ideal method to remove the website field since you won’t have to worry about modifying a theme or core file which may change.
1. Navigate to your /wp-content/plugins/ directory and create a file named urlfilter.php. You can create and modify the file using your web hosts file manager or ssh account. Alternatively, you can create the file locally and upload it via ftp or through your web hosts file manager. Notice the majority of plugins have their own folders here, however, you do not need to create a folder for this plugin.
2. Place the following within the contents of the file urlfilter.php:
<?php /* Plugin Name: Remove Website Field Description: Removes the website field from the comments form */ add_filter('comment_form_default_fields', 'url_filtered'); function url_filtered($fields) { if(isset($fields['url'])) unset($fields['url']); return $fields; } ?>
3. Save your changes. If you modified the file directly through your web hosts file manager or SSH account then you’re set. If you created the file locally you will need to upload it via FTP or through you web hosts file manager to the /wp-content/plugins/ directory.
4. Go to the Plugins menu and you will now see a plugin named Remove Website Field. Enable the plugin by clicking on the ‘Activate’ link under the plugin name. The ‘Website’ field has been successfully removed from your comment form and no one will see it anymore.
In case you are curious, the following method will also remove the website field but it requires modifying a core WordPress file. This is not recommended since these are considered sensitive files. Additionally, you would have to modify the core file each time you upgrade WordPress.
You’ll need to modify the core WordPress file named ‘comment-template.php’ located within the ‘wp-includes’ directory. To modify this file I did so through my web hosts file manager. You can also access the file through your ftp or ssh account if you have one. Before doing anything, make sure to BACKUP the file so you can revert to your original copy if need be. You MUST modify the file with a plain text editor and NOT a word processing program as they can break your code.
How to remove the website field from the comment form by editing the /wp-includes/comment-template.php file:
1. Search for the following within the file, it’s located near the end.
'url' =>
2. You should end up at the following:
1 2 | '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>', |
3. Place two forward slashes before each line to comment them out:
1 2 | // '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>', |
4. Save your changes. If you modified the file directly through your web hosts file manager or via SSH then you’re set. If you downloaded it via FTP or file manager and saved the changes locally, you will have to overwrite/replace the old one.
The ‘Website’ field has been successfully removed from your comment form and no one will see it anymore.
NOTE: There are other ways to remove the website field which I didn’t explore and there are other means to stop spam such as using a plugin. I may review such plugins sometime in the future.

Nice and very clean solution. I never really thought about this, but I can see myself using these custom written plugins a lot more often in the future.
I love the idea and found your post looking for this exact thing, but for some reason it isn’t working on my site. I made the php file, uploaded it, activated the plugin, but the website field is still there. Any suggestions, would be greatly appreciated!
On the Dashboard, go to Appearance -> Editor -> Stylesheet (style.css) and add the following within the file:
#commentform #url, #commentform #url +label {display:none;}
I’ll update the article soon with this method. It’s much easier and quicker.
Thanks, that did the trick…
I prefer the plugin, to just hiding with css
Me too. Is `#commentform #url, #commentform #url +label {display:none;}` guaranteed in every theme anyway?
The plugin didn’t work for me.
The CSS managed to hide the text box. But the label is still there.
Any suggestions?
Avrohom
Me too. Doesn’t work
Most probably this is the first time I’m commenting on a form that does not have website field. Its funny. But I reached your post through search engine as I had to remove URL field out form my comment form. I don’t need it in my blog ICT Trends.
Thanks for the good post and the method worked great for me!
Wow, if it’s that easy I wonder why there isn’t just a checkbox for it in the dashboard… :/
Thank you very much!!!
THanks for the article. The method of your comment just removed the field but left the label there, so its weird. My label’s name is “Website:” . Is there an easy way to remove that too?
Did you allready find out how to remove THE label? If yes, please share your solution. Thank you!
Thanks for this information! I was just about to edit the comment.php file when I came across this post! Very simple to do and works like a charm!
{display:none;}, fantastic!
what would i change in your urlfilter.php file if i also want to remove the email field as well?
I am very new to the whole website building; so I have been very reluctant to change any of the .php files. But just inserting “//” was very straight forward and EASY! Thank you!
hI guys,
i cant find the #commentform in my style css.
i have the twenty ten template.
Any ideas?
Is not working with WordPress 3.1.3
actuallay i have wordpress 3.2.
now i’m looking for this code:
Webseite
This is great. I’ve been looking for a way to eliminate spam comments. This almost does the trick, however spambots can still send a post query to your wp-comments.php file with a URL. What I’ve done is put the following line at the top of wp-comments.php
if(!empty($_POST['url'])){
exit;
}
Now if anyone tries to submit a URL, its spam and the comment will be entirely blocked. You will also want to set your discussion options to moderate any comments that contain one or mor links within the comment text itself.
Superb! Thank you Zee. I added the .php file as above via file manager and it worked – straight out of the box.
A Great and Very Good Solution.
Thank You
Raj
Nice and clean solution, thank you.
The plugin method worked like a breeze. You also made me realize how simple creating a plugin is!
Thanks
Thank you for this!
Superb! thanks a lot!
That worked beautifully! Thank you very much. oops, I clicked on one of your ads…….. =) well deserved
Thank u!!
Good stuff, you can also achieve the same effect by adding this code to functions.php of your theme
Yes – thanks. Couldn’t figure out this filter using the codex documentation! I just added it to my function.php file too.
Great Solution! Simple to set up and the plugin won’t get changed in an update.
11636224
The plug-in method worked great for me. Thanks for the useful info.
Your plugin is an easy and elegant solution. Pasted your code into a text document and uploaded through ftp to plugin folder. Worked like a charm. Thank you so much!