Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Umberto,

    In WordPress Multisite, the registration settings are typically controlled at the network level rather than for individual sites. This means that the Network Admin controls whether or not new users can register across the entire network. Unfortunately, by default, there’s no built-in way to activate or deactivate registration on individual sites independently from the network.

    However, you can implement a solution with a custom plugin or a code snippet to enable registration control on individual sites.Approach: Use Custom Code (or a Plugin)

    1. Restrict Registration per Site using a Plugin: There isn’t a built-in setting in WordPress Multisite to enable site-level registration controls, but you can either create a custom plugin or use a plugin like “WP Multisite User Registration” or “Multisite User Management”. These plugins provide additional control over registration on a per-site basis.Alternatively, you can add custom code to your theme’s functions.php file or a custom plugin.
    2. Custom Code Solution:Add this code to the functions.php file of your theme (preferably in a custom plugin so it’s not lost if you change themes):

    // Disable user registration for individual sites in a Multisite Network
    function disable_site_registration() {
    // Only run on individual sites
    if ( !is_multisite() || is_network_admin() ) {
    return;
    }

    // Check if registration is disabled for the network
    if ( !is_user_logged_in() && !get_site_option( 'users_can_register' ) ) {
        wp_die( 'User registration is disabled on this site.' );
    }

    }
    add_action(‘init’, ‘disable_site_registration’);

    1. This will ensure that registration is controlled by the network settings, but will block registration on individual sites if the network-wide registration is disabled.
    2. More Granular Control with Plugins: If you’d prefer a plugin solution, you can try these:
      • User Registration – WP Multisite: This plugin allows you to configure registration per site and provides better control over registration on a per-site basis.
      • Multisite User Management: This plugin provides additional controls for user roles and site-specific registration options.

    How it works:

    • The above code ensures that if network registration is disabled, it will prevent users from registering on the individual site level as well.
    • By using the get_site_option( 'users_can_register' ), you check if user registration is enabled at the network level.
    • If you want specific sites to allow registration, you could further modify the logic by adding conditions to check for certain sites (using get_current_blog_id()), or by creating a custom option that controls registration per site.

    Yes, you’re on the right track. When you install WordPress on a hosting platform, they usually provide an automated installer (such as Softaculous, Fantastico, or other one-click installers), which handles the WordPress setup process for you. It typically involves filling in a config file (the wp-config.php file), setting up a database, and configuring the site for you to access right away without any manual setup.

    If you want to do this yourself, here’s a simplified guide to achieve the same result:1. Set up the Hosting Environment:

    • Make sure your hosting provider has PHP, MySQL, and the required system requirements for WordPress. Most shared hosts offer this by default.

    2. Download WordPress:

    • Download the latest version of WordPress from wordpress

    3. Upload WordPress Files:

    • Upload the WordPress files to your web server. You can either use FTP or your hosting provider’s file manager to upload the files to the public directory (often public_html or www).

    4. Create a Database:

    • In your hosting control panel (such as cPanel), create a new MySQL database and user, and then assign the user to the database with full privileges.

    5. Configure the wp-config.php File:

    • WordPress needs to connect to your database, so it uses the wp-config.php file to store this information. If you didn’t upload the wp-config.php file yet, copy the wp-config-sample.php to wp-config.php and edit it.

    define( ‘DB_NAME’, ‘your_database_name’ );
    define( ‘DB_USER’, ‘your_database_user’ );
    define( ‘DB_PASSWORD’, ‘your_database_password’ );
    define( ‘DB_HOST’, ‘localhost’ );

    6. Run the WordPress Installation:

    • Once the files are uploaded and wp-config.php is configured, visit your website in the browser. WordPress will prompt you to complete the installation by setting up your site title, admin user, password, and email.

    7. Done:

    • After the installation is complete, you can log in to your WordPress dashboard directly without needing to go through the installation process again.

    To Avoid the Installation Screen:

    To prevent the WordPress installation page from showing up again when you access the website (for example, after moving files or setting up WordPress), ensure that:

    • Your wp-config.php is correctly configured.
    • The database credentials are correct.
    • There are no issues with file permissions on the server.

    If the site is already showing the installation page, check if the database is set up properly, and make sure the correct database details are entered in the wp-config.php file.

    Would you like me to help with any specific part of the process?

Viewing 2 replies - 1 through 2 (of 2 total)