diff --git a/modules/sportspress-user-registration.php b/modules/sportspress-user-registration.php
index e2bc5442..8ea979ac 100644
--- a/modules/sportspress-user-registration.php
+++ b/modules/sportspress-user-registration.php
@@ -97,8 +97,8 @@ class SportsPress_User_Registration {
*/
public static function register_form() {
if ( 'yes' === get_option( 'sportspress_registration_name_inputs', 'no' ) ) {
- $first_name = ( ! empty( $_POST['first_name'] ) ) ? trim( $_POST['first_name'] ) : '';
- $last_name = ( ! empty( $_POST['last_name'] ) ) ? trim( $_POST['last_name'] ) : '';
+ $first_name = ( ! empty( $_POST['first_name'] ) ) ? trim( sanitize_text_field( $_POST['first_name'] ) ) : '';
+ $last_name = ( ! empty( $_POST['last_name'] ) ) ? trim( sanitize_text_field( $_POST['last_name'] ) ) : '';
?>