# Allow HTML in Author Bios

> Keeps links and basic formatting in the Biographical Info field for users who are trusted with unfiltered HTML, instead of stripping it.

- Type: PHP
- Runs: Run everywhere
- Category: [Users](https://wpide.com/library/category/users/)
- Tags: users, profile, html
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/allow-html-in-author-bios/

## Code

```php
add_action( 'init', function () {
    if ( current_user_can( 'unfiltered_html' ) ) {
        remove_filter( 'pre_user_description', 'wp_filter_kses' );
        add_filter( 'pre_user_description', 'wp_filter_post_kses' );
    }
} );
```

## Notes

Bios are filtered with the same rules as post content, so scripts are still removed.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Allow HTML in Author Bios" 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/
