As a network admin in multisite configuration, I have the option to enable or disable the user registration site registration. is there any way i can enable the user registration on s single sub site , not on all sites.
In my WP setup, I have a main blog which is managed by me and I dont want user to register here. i have a another blog installed on sub directory dedicated for forum. I would like to enable user registration here, so that user can use the forum
The multisite setup allows you to enable and disable user registration at the network level but if you see the database it store the value in the
wp_options
tables for each site.So we can try the below and see if this work.
Use the below code in the
functions.php
file.If the updation is successful, you will get
true
elsefalse
Now you can use the function to enable any subsites in the MU setup by passing the sub sites
id
to the function in place of$blog_id
Multisite adds a filter for
get_option('users_can_register')
calls inms-functions.php
users_can_register_signup_filter
. This filter circumvents any blog-level settings you try to implement.