Remove "I would like my site to appear in search engines"

Hello,

I'm setting up a secure Multisite network for students and I don't want any search engines indexing.

I have Multisite Privacy plugin installed and setup.

My question is How do I remove the "I would like my site to appear in search engines" option on the registration page. Some students are concerned about having their sites public. I just want to remove it and not need to explain the Privacy plugin settings.

Thanks

  • Michael Bissett

    Hey @jayjay, Michael here! :slight_smile:

    This can be done easily by doing two things:

    #1: Inside your Network Dashboard, head to:

    Settings -> Network Settings

    And in the "Site Privacy Settings" section, set "Default Setting" to "Block search engines from all sites, but allow normal visitors to see all sites."

    #2: Once that's been done, insert the following code into a mu-plugin:

    function mb_hide_public_signup_option() {
    	echo '<style>
    	.mu_register div#new-privacy label[for="public_on"],
    	.mu_register div#new-privacy label[for="public_on"] + br {
    		display: none !important;
    	}
    	</style>';
    }
    add_action( 'signup_header', 'wpmudev_visual_editor_css_fix' );

    That'll take care of hiding the public option on the front end. :slight_smile:

    To create a mu-plugin, you'll want to log into your site via FTP, and go to your /wp-content/ folder via FTP, finding the folder called "mu-plugins".

    If there's no folder with that name, then you'll want to create one. Then, create a file inside that folder, and give the file any name you like (making sure the file has an extension of .php, e.g. example.php) and paste the code in there.

    It'll always be active, so there's no need to activate the plugin after creation. Be sure to add a PHP start tag at the beginning of the code, like this:

    <?php

    Hope this helps! :slight_smile:

    Kind Regards,
    Michael

  • jayjay

    Hello @Michael Bissett,

    Thanks for the help. I don't seem to be able to get this to work.

    Here's what I've done. Can you make sure I've done everything correctly and didn't miss any steps.

    1. Created a mu-plugins folder in wp-content
    2. Created a file called nosearch.php
    3. Added this code into the file:
    <?php
    function mb_hide_public_signup_option() {
    echo '<style>
    .mu_register div#new-privacy label[for="public_on"],
    .mu_register div#new-privacy label[for="public_on"] + br {
    display: none !important;
    }
    </style>';
    }
    add_action( 'signup_header', 'wpmudev_visual_editor_css_fix' );

    4. I changed the Default Settings to Block search engines....

    It's still showing on the registration page.

    I have the Multisite Privacy plugin installed on the network and I have that set to Allow Network Administrators to set a single password...

    Not sure if that makes a difference.

    Again, thanks for the help.

    jayjay

  • Michael Bissett

    Hey @jayjay, thanks for your patience here! :slight_smile:

    Okay, with a fresh look at this (and more coffee), I'm seeing that you're referring to the options over on the Create a Site page generated by BuddyPress:

    http://screencast.com/t/c5zmn5Y8F

    In that case, we're going to need a different snippet, could you please try inserting the following CSS into a plugin like Simple Custom CSS:

    body.blogs.create-blog.buddypress form#setupform > p:nth-of-type(2) {
        display: none;
    }

    I've found it to work over on my own test site. :slight_smile:

    Kind Regards,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.