Home / comment / Remove / unset URL field from comment form
  • How to Remove / unset URL field from comment form


    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.

    ( click code to copy )

    wordpress snippet : PHP

    add_filter('comment_form_default_fields', 'unset_url_field');
    function unset_url_field($fields){
           return $fields;

    ( WordPress codex functions, hooks, in this snippet. )

    comment_form, add_filter,
  • 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.

    • 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;



  • 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.

    • 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,