wordpress snippets last updated   : January 29, 2015
we now have 646 snippets

Remove / unset URL field from comment form

wordpress snippet

Removing the URL field from your comments form is a simple snippet just add this code to the functions.php of your wordpress theme to remove the URL / website field.

snippet :  PHPcopy
add_filter('comment_form_default_fields', 'unset_url_field');
function unset_url_field($fields){
       return $fields;
source →

Did you like this post? If so please share it with your friends. Thanks!

  • GoWebBaby WorDPress Firm

    Why to remove url field from the comment form, it encourage commenter to comment instead of it better to assign no follow link attribute.

    • http://wpsnipp.com Kevin Chard

      This snippet is more for people that are working on a theme, removing the field could be used for product reviews or if they created a support tickets theme that does not require a url field.

      • Shaun Palmer

        // I just want to unset from comment form the Home page

        add_filter(‘comment_form_default_fields’, ‘unset_url_field’);

        if($fields = is_home() || is_front_page() {

        function unset_url_field($fields){



        return $fields;



  • http://twitter.com/shaunpalmernz shaun palmer

    try it like this but not working if(have_some_suggestion){

    function unset_url_field($page_id ){

    if(isset($page_id [‘url’]))

    unset($page_id [‘url’]);

    return $page_id ;



  • Pingback: How To Remove The URL Field From WordPress Comments - WPMU.org()

  • M

    Gave me the white screen of death.

    • http://wpsnipp.com Kevin Chard

      This is more likely an issue with the functions.php file rather than the snippet. I would check the functions.php file to make sure,