Disabling WordPress “Website URL” Comment Field

For sometime now, i disabled/removed the field for commentators to input their website link while dropping a comment because of the excessive spam comments i was receiving. afterward, i wasn’t receiving comment on this blog because commentators won’t have any incentive in wasting their time writing comment. for a moment i felt relieve as i now have the time in the world to focus on my article writing.
A comment by Adrian Jock made me did a re-think. for some reasons best known to me, i have decided to make public the website URL field in comment form.

Tech4sky.com Comment form without website field
For those who may be curious on how i removed the URL field, am going to share how i did it. mind you, this blog is built on the awesome Genesis theme framework. i didn’t have to edit my theme core file because my hack will be wiped away by an update nor use a plugin. all i did was to get the CSS ID or class wrapping the website url field.
This can be gotten when you view your website source-code (Ctrl+U) or use Firebug add-on for Firefox browser or Element inspection in Chrome and Opera.

For Genesis framework, the URL field is wrap with

<p class="comment-form-url">  </p>

from the code above, we now know the CSS class used is comment-form-url so i wrote a little CSS rule to hide the field using the code below;

[css].comment-form-url {
display: none;
} [/css]

The website url field should now be hidden. next thing i did was to install and activate Disable comment author links. as it name goes, the plugin removes all hyperlinks from comment author user names and strip all links from commenter names wherever they may appear throughout your site’s theme.
Alternatively, if you do not want to use the plugin, insert the below code in your theme function.php file.

 <?php if( !function_exists("disable_comment_author_links")){
		function disable_comment_author_links( $author_link ){
			return strip_tags( $author_link );
		}
		add_filter( 'get_comment_author_link', 'disable_comment_author_links' );
	}

?> 

Only do this if you actually do not want comment on your blog unless you are an indispensable expert in your field 😀

Don’t miss out!
Subscribe to My Newsletter
Invalid email address