HTTP/2 301
server: nginx
date: Sat, 27 Dec 2025 23:04:41 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/hooks/sanitize_user/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
HTTP/2 200
server: nginx
date: Sat, 27 Dec 2025 23:04:41 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
sanitize_user – Hook | Developer.WordPress.org
apply_filters( ‘sanitize_user’, string $username, string $raw_username, bool $strict )
Filters a sanitized username string.
$usernamestringSanitized username.
$raw_usernamestringThe username prior to sanitization.
$strictboolWhether to limit the sanitization to specific characters.
| Version | Description |
|---|
| 2.0.1 | Introduced. |
Example migrated from Codex:
Filters a user name to be lower-cased after sanitization by sanitize_user()