Skip to content

PHP Customization - add username in Arabic for register page

1 minute read

This PHP code added function to Wordpress for Username can be write in Arabic

php
add_filter('sanitize_user', static function ($username, $rawUserName, $strict) {
            if (!$strict) {
                return $username;
            }

            return sanitize_user(stripslashes($rawUserName), false);
        }, 10, 3);

Please use this code in your Child Theme functions.php . You can read more about Child Themes here:

Open theme editor in your Wp-Admin (make sure you have selected MyHome Child to edit)

3. Paste this code at the bottom on file functions.php

4. After this change your user can register username in Arabic alphabet.

Ask the people who build MyHome WPBakery

We answer by email from support@tangiblewp.com. With Premium Support, we also fix your site when something breaks.

Was this guide helpful?