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?
- Is it possible to remove username field from the registration page? If so, how?
- users table – user_name vs. nicename
- Can I hook into user registration *before* a user is created?
- How to limit user registration to a specific set of domains?
- How do I create a user using the new JSON api in 4.7?
- Insert “New User” and update/set meta data at once
- Send automatic email to user after wp_create_user
- How to prevent certain usernames from being registered?
- 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?
- wp_create_user hook
- White spaces in username give 404 on author page
- 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?
- Buddypress Fake (non-bot) Users [closed]
- How to allow more than one registered user to have the same email?
- Is there a maximum length to user passwords?
- How to add additional information to a user on user creation?
- How to allow wordpress to create username with symbols like +
- user activation email doesn’t work
- Invalid key on activation and password reset
- How can I have user registration verify a whether a new user is listed in a table of pre-approved users?
- Mobile User Registration
- Conditionally registering users
- WordPress Register Form
- Creating custom registration and login link in wordpress
- Adding register & login in WordPress website
- registration form not working
- How can I disable all client side new accounts without disabling new user accounts?
- Unique registration for new writers to sign up
- Custom registration form with different registration process based on what’s selected
- Is that possible show user’s post after user login
- 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
- How to register a user to a group by an invitation code?
- Register form how to get Total Control of it
- I want to add a tax-ID field in registration form and upon submission, perform a lookup by tax-ID
- Custom user registration
- Modifying the Default Registeration Page?
- WordPress + bbPress registration user-unfriendly?
- Force display name to nickname wp
- not sending correct link to set the password in registration email [closed]
- wp_insert_user not returning anything
- New register email notification sending some fields blank on site admin emai id
- wp_insert_user function not adding password field to database
- Profile picture in registration form WordPress [closed]
- Controller functionality – User not logged in/ redirect to registration page (not wp_login)
- wp_register() displays logged in user as site admin
- loading custom registration template
- Create a post with user_register doesn’t create title
- User activation in wordpress
- Why is wp_new_user_notification not working?
- How to add user registration and signup in WordPress and create members only page?
- Single Sign On or Bridge with in the WordPress WebSites?
- Is there a way to check the email of the user trying to register before he registers?
- signup_user() throws fatal error
- Custom Registration Form Based on user location Woocommerce
- WordPress – Use user meta in ‘user_register’ after new registration
- Action Hook that fires function upon registration at Woocommerce checkout
- My new website registration error
- Not receiving any sign up mail, when user registers… Both admin & user
- WordPress is sending an empty email after using wp_insert_user
- Creating custom registration and login page in wordpress
- Create a unique username with validation on wordpress registration
- I want to give every new registering user a unique key apart from password field for external use
- Is it possible to remove the password field in the registration page in woocommerce?
- wp_insert_user if user exists
- I have restricted the username to numerical format but not able to integrate the same with PeepSo plugin
- How to hide username on wordpress registration?
- What’s the Point of Spam Registrations?
- Add custom Date column to “All Users” admin panel in WP
- Can’t figure out how people are registering on my site
- Update a user field with a generated text
- Custom Registration with Select and Upload function
- Custom user creation and auto login problem
- How to generate Registration no
- generate an auto incremented id number when a new user is registered
- Remove wp-login link from auto generated wordpress’s email
- Upon registration, redirect new user to Dashboard
- Disallow google/other email plus and dot tricks when registering?
- disabling emails received by admins every time a new user signs up (function not working)
- how to allow unregistred users to view normal posts [closed]
- Wrong user registration date in wordpress
- A conditional button
- Plugin recommendation for directory site [closed]
- enqueue style google fonts in functions.php in array?
- Fields in register page is pre-filled out with name and email
- Login to comment: not just user and email
- Group users by meta_value
- Run custom validation only if all other wordpress registration form validation was successful
- I want to set the shipping_first_name metadata value to match the first_name metadata value for a User on registration using a function