Limit username to specific characters (A-Z and 0-9)

Using the regex posted by Moaz (and adding capitals), we will need to hook into the registration_errors filter: // Restrict username registration to alphanumerics add_filter(‘registration_errors’, ‘limit_username_alphanumerics’, 10, 3); function limit_username_alphanumerics ($errors, $name) { if ( ! preg_match(‘/^[A-Za-z0-9]{3,16}$/’, $name) ){ $errors->add( ‘user_name’, __(‘<strong>ERROR</strong>: Username can only contain alphanumerics (A-Z 0-9)’,’CCooper’) ); } return $errors; }

How to Disable UNICODE slug?

My solution using 3 combined hooks wp_insert_post_data, wp_ajax_sample-permalink,name_save_pre //==================DISABLE GEORGIAN + Russian SLUGS for POSTS================ //disable slug on any update add_filter(‘wp_insert_post_data’, ‘myappend_slug’, 3); function myappend_slug($data) { $data[‘post_name’]= slug_modify($data[‘post_name’]);return $data; } add_action( ‘wp_ajax_sample-permalink’, ‘MyajaxSamplePermalink’,1); function MyajaxSamplePermalink($data) { // check that we’re dealing with a product, and editing the slug $post_id = isset($_POST[‘post_id’]) ? intval($_POST[‘post_id’]) : 0; … Read more