# Hide the "Logged in as" Line Above Comments

> Removes the "Logged in as … Edit your profile. Log out?" line from the top of the comment form for a cleaner look on member sites.

- Type: PHP
- Runs: Run everywhere
- Category: [Forms](https://wpide.com/library/category/forms/)
- Tags: comments, cleanup, members
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/form-comment-hide-logged-in-as/

## Code

```php
add_filter( 'comment_form_defaults', function ( $defaults ) {
    $defaults['logged_in_as'] = '';

    return $defaults;
} );
```

## Notes

Members can still log out from the admin bar or your account menu.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide the "Logged in as" Line Above 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/
