[wp-hackers] How to remove URL field in Comments Form

Beau Lebens beau at dentedreality.com.au
Thu Aug 26 01:07:18 UTC 2010


If you're using the new default theme, Twenty Ten, then you could
write a filter that would remove it before comment_form() is called.
It would look something like this (in your functions.php, or a plugin,
or whatever):

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

If you're using a theme that doesn't use comment_form() (new in 3.0,
so very likely), then you'd need to just hack the comments.php file
within your theme normally. Since the URL field is not required, you
shouldn't need to do any special handling (un-handling) to get around
that.

I just did a short presentation on the comment_form() function at
WordCamp Savannah:
http://www.slideshare.net/beaulebens/hooking-into-comments-5047868

Beau


On Wed, Aug 25, 2010 at 5:33 AM, Baki Goxhaj <banago at gmail.com> wrote:
> I want to get rid of the url field in my comments form - how can I achieve
> that? Thanks!
>
> Kindly,
>
> Baki Goxhaj
> www.wplancer.com | www.banago.info | www.lintuts.com
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list