This code should make it impossible to add a new user, as long as it is being added with wp_insert_user()
.
add_filter( 'pre_user_login', '__return_false' );
That filter is applied to the user’s login name before it is saved. If the result is empty, the user isn’t added. This will make it so the login will always be empty, so it will be impossible to add new users, even from the administration panels.
Related Posts:
- Getting thousands of registration spam
- Prevent registration except through form
- How do spam users register while I’ve only enabled registration by Gmail via Janrain?
- Spam Registrations Bypassing WordPress Registration
- Is it possible to remove username field from the registration page? If so, how?
- users table – user_name vs. nicename
- Google Apps login in wordpress
- How do I create a password reset link?
- Can I hook into user registration *before* a user is created?
- How can I be certain that a user has verified their email after registration?
- Placeholder text for registration form
- Use the user_activation_key for other purposes
- How to limit user registration to a specific set of domains?
- Stop spam users from registering without disabling user registration?
- How do I create a user using the new JSON api in 4.7?
- How to check if the user registration is allowed/active?
- how to disable user confirmation from administration?
- Custom registration form page/template
- Insert “New User” and update/set meta data at once
- Send automatic email to user after wp_create_user
- Mail isn’t sent after local site registration
- How to prevent certain usernames from being registered?
- How to disable or protect against disposable email accounts?
- Changing username after registration to get around the issue of having duplicate emails?
- Registration key
- User defined password at registration – registration email sends auto generated pass
- What is the best way to avoid spammers registering to my blog?
- Advice on setting up a site with front end registration
- How to add a description to the user name input field in the registration form?
- Creating a Closed WordPress Community Using Referral Codes
- How to add a checkbox to registration and user profile?
- How Do I Prevent Junk Account Creation?
- Function like is_registration_page to check if current page is registration page
- wp_create_user hook
- Payment on Registration?
- White spaces in username give 404 on author page
- WordPress members-only page with link visible only to members
- Password field (and confirmation) showing up twice on registration
- auto assign sequence base username while registration
- How to disable user registration for the default subscriber user role?
- How do I show errors after validation with a custom form frontend?
- Remove default user registration, login and subscriber profiles
- Buddypress Fake (non-bot) Users [closed]
- How can I find users that didn’t set a password?
- How to allow more than one registered user to have the same email?
- Send custom signup approval email to different Administrators selectively
- Is there a maximum length to user passwords?
- Registering without e-mail adress!
- Batch users creation
- After e-junkie payment, send a http post to register user automatically?
- Checked checkbox?
- Set user password after creating user
- Email confirmation in user registration form without a plugin
- How to add additional information to a user on user creation?
- On user registration, if welcome mail sent, add post with new user as author
- How to allow wordpress to create username with symbols like +
- How to bypass the username as a required field in registration and just use email address instead?
- Does the user_register change in multisite?
- Registration options and approvals
- user activation email doesn’t work
- Invalid key on activation and password reset
- Where are people registering on my website?
- How to disallow user to register with a specific word in the username?
- How can I have user registration verify a whether a new user is listed in a table of pre-approved users?
- How to stop WordPress emailing a password
- Mobile User Registration
- Change User Registration
- Conditionally registering users
- WordPress Register Form
- On multisite, plugins are disabled prematurely when viewing the /wp-activate.php page file
- Creating custom registration and login link in wordpress
- Adding register & login in WordPress website
- Adding register & login at top right corner
- Backend user creation form with additional language field
- Restrict certain character combinations in username during registration
- registration form not working
- How can I disable all client side new accounts without disabling new user accounts?
- All users/comments suspected as bot? [closed]
- Register users without confirmation
- Override default new user registration email with custom message (non sub-domain multi-site installation)
- Unique registration for new writers to sign up
- How to receive notifications when a new user registers
- Include “registration.php” for custom registration form?
- Regsitration form on External page
- Custom registration form with different registration process based on what’s selected
- can registration be enabled programatically?
- Is that possible show user’s post after user login
- allow only lowercase user registrations
- How do I set user account inactive?
- register user only with specific Host name
- Generate long hashed user ID
- Disable New User Registration Email sent to WordPress admin email on 4.9.5
- my custom css file downloads then it STOPS!
- Restrict partially matching usernames
- Filter for users on custom post type
- How to register a user to a group by an invitation code?
- Register form how to get Total Control of it
- Registration area + reserved area
- I want to add a tax-ID field in registration form and upon submission, perform a lookup by tax-ID
- Custom user registration