You can do it by using this code:
add_action('init', 'update_anyone_can_register');
function update_anyone_can_register() {
update_option('users_can_register', true);
}
I tested on my functions.php file and it worked as expected.
Related Posts:
- How to pass external variables to the wp_new_user_notification_email filter?
- How to display all post from the same current usermeta
- Changing starting number of User ID
- User registration add user ID?
- How to change the default registration email ? (plugin and/or non-plugin)
- How to update the delete user confirmation form?
- Integrating WordPress to my website, while keeping my own authentication system
- Modify custom Users Manage page
- How to Save Different Usermeta Fields According to User Role?
- generate unique number when registering a user
- Adding extra info via GET while registeration in wordpress
- Authenticating to WordPress, using my own authentication two-factor system
- Many users with strange names register, but don’t leave comments. Should I be afraid?
- Set user loggin status?
- How can I add data to a custom column in the Users section of the wordpress backend?
- Unique User Account Number + Displayed Via Shortcode
- Last time a user logged in
- Updating Custom WordPress User Meta Field via REST API
- How can I allow access to multiple users, using the same login, at the same time?
- Creating user relationships
- Add custom user profile field to default WordPress MultiSite registration form
- What’s wrong with Customizing new user notification email by add_filter?
- Make custom user table column filterable
- Add ‘Creator’ User Meta when adding user
- Follow me for WordPress blogs (multi-authors)
- I want to submit multiple users if checkbox is checked
- Change the Labels of Users to Customers in Admin
- user_profile_update_errors hook not executing
- How Can I Move Data From Form 1 To Form 2
- Auto login from custom registration form
- Diffrent User registration form for doctor and patient
- User can not login
- Allow guests to use WP Customizer but disable save button
- Users can only view their content from the front end
- List top 5 authors with most posts
- Multi-site User Sessions
- Add Field to WordPress Register Form
- Problem with custom user meta field
- Customizing Users in Admin Area
- how to make a custom field readonly or disabled by user role?
- How to make wordpress use a non-wordpress users table?
- Custom login and registration forms
- Create Unique ID for user
- Custom Register Link on Backend Form
- Personalized Gallery what are my options?
- how or where wordress collect unlogged user session
- Hook before user is created and make some custom validation
- How to change the login page without a plugin and not only customizing logo and text around the form?
- No plugin populate user information in to form
- Invitation link to a site in multisite network does not work?
- WP_User_Query Search Multiple Keywords from a Multi-Select Field?
- Highlight specific user with custom field value
- Change the functionality of wordpress users module in admin
- Custom user fields validation on registration
- Custom options – register, defaults and delete empty fields (Settings API)
- add unique code required to register
- Custom search by several options send on form not works
- How to create functions that affect only a specific user
- Create users via PHP
- Use wp_login_form function to login with a custom user table?
- How to get value from wp_usermeta table in database?
- Is it possible assign a secondary existing role to already existing one?
- Redirect all pages to the custom login page except for the registration page
- User Query Multiple Orderby Clause
- Some data of one custom user profile is erased when I update another custom user profile
- Essential technical features for high-end WordPress web hosting? [closed]
- How To Add Custom Form Fields To The User Profile Page?
- Default value for add_settings_field
- Disable Visible Edit Shortcuts in the Customizer
- How to make a script load after Custom Block is loaded in the editor?
- How to edit the actual paragraph dropdown in TinyMCE with custom text styles
- Force display name as full name
- Add control in image detail panel
- using upload image with media_handle_upload .. but !
- wp_nav_menu() custom container and container_id
- No option to add a ‘featured image’ in my wordpress installation
- FireFox Inspector :: find CSS file related to
- How-to inspect filter-able $vars?
- pagination in woocommerce order history page
- Combine multiple words in custom meta search query
- How to run a test WordPressMu to WordPress3 update?
- Comparing two WordPress installations
- WordPress development using Docker – how to share directories? [closed]
- How to add more than one RSS Feed Link for wordpress
- custom session variables being lost in FF [closed]
- How to link external JavaScript files?
- How to create a list of items with fields in WordPress?
- For custom templates, is it better to use `template_include` or `type_template`?
- Remove ability to Permanently delete an image from the Media Library
- Filter posts by custom taxonomy terms
- shortcodes – style them or change/remove the square brackets?
- Dynamic title in WordPress homepage
- Custom title, Bones theme
- How to create a completely private wordpress with multiple membership levels
- Why do posts disappear from admin after upgrading from WP 2.7.1 to 3.0.1?
- How to change the category url jusy show /category/%category_id% in wordpress?
- How can I display a PHP foreach loop’s answers by AJAX
- Child Theme with multiple css files
- How can I make a search term redirect to a page
- How can I get the Media Library backend to show larger thumbnails?