# Remove the Website Field From Comments

> Removes the Website (URL) field from the comment form, which discourages comments posted only to get a link.

- Type: PHP
- Runs: Run everywhere
- Category: [Comments](https://wpide.com/library/category/comments/)
- Tags: comments, spam, form
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/remove-comment-website-field/

## Code

```php
add_filter( 'comment_form_default_fields', function ( $fields ) {
    unset( $fields['url'] );

    return $fields;
} );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Remove the Website Field From Comments" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
