How to remove the Website field from WordPress comments

As the website field is often abused by spammers and not that relevant for many types of blogs, I recommend removing it from your site. Sadly WordPress still doesn’t have it as a default option under Settings > Discussion to hide the Website field, but there are a few ways to remove it.

Using a code snippet

My favorite way of hiding the Website field from the comments form in WordPress is using a code snippet. I use the free Code Snippets plugin to add custom code to my WordPress sites.

The code snippet

The following PHP code snippet will remove the Website field from the comments form.

function fastlaunch_remove_website_field( $fields ) {
 unset( $fields['url'] );
 return $fields;
}
add_filter( 'comment_form_fields', 'fastlaunch_remove_website_field' );

However already submitted comments may still have a link on the comment author name. If you want to remove the existing links from the author names, you can use this code snippet to show only the author name without any link.

function fastlaunch_remove_comment_author_link( $return, $author, $comment_ID ) {
 return $author;
}
add_filter( 'get_comment_author_link', 'fastlaunch_remove_comment_author_link', 10, 3 );

Other solutions

I prefer to have less plugins and I don’t mind adding my own custom code snippets to the site/ But maybe you really don’t want to be messing around with code? In that case there are some plugins that have this code build into them. You can for example try the Comment Link Remove and Other Comment Tools plugin or the Remove Website Link Field From Comment Section plugin.


Comments

Leave a Reply