correct validate inputs October 19, 2022 by Tarik Billa Try $name = trim( sanitize_user( $_POST['name'], true ) ); Be sure that the function does what you want! Read here