Questions for Multisite

#489543
  • Resolved Illuminatus Marketing
    Rank Math agency
    Content AI Expert

    Hey, was going to purchase for Cyber Monday. Had a few questions so I know if this will work for us:

    1. I do not want any child site to have access to .htaccess or robots.txt

    How can I make sure that no admin has this on child sites?

    2. Are there ways to block pages like tracking from child sites admins? Or is there a “superadmin only” mode?

Viewing 1 replies (of 1 total)
  • Md. Sakib Khandaker
    Rank Math agency

    Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention.

    For both of your queries, I can suggest you to use the Role Manager feature of Rank Math, which helps you to choose and allow different user-roles to get access to the selected features.

    #1 ~ I do not want any child site to have access to .htaccess or robots.txt. How can I make sure that no admin has this on child sites?

    In this case, you may either disable access to the General settings by unchecking the box directly from the settings. That should prevent them from accessing the entire General Settings or, if you decide to disable access to only .htaccess or robots.txt in general settings, you may try using the code below to see if that works for you.

    function rm_user_has_role($user_id, $role_name){
    	$user_meta = get_userdata($user_id);
        	$user_roles = $user_meta->roles;
    
    	return in_array($role_name, $user_roles);
    }
    
    add_filter( 'rank_math/settings/general', function( $tabs) {
    
    	$user_is_not_allowed = rm_user_has_role(get_current_user_id(), 'administrator'); //Replace user role 'administrator' with your preferable user role.
    	
    	if($user_is_not_allowed){
    		unset( $tabs['htaccess'] ); // Unsets Edit .htaccess tab.
    		unset( $tabs['robots'] ); // Unsets Edit robots.txt tab.
    	}
    	
    	return $tabs;
    });

    Here’s how you can add filters/hooks to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    #2 ~ Are there ways to block pages like tracking from child sites admins? Or is there a “superadmin only” mode?

    If I’m getting you right, you’re asking about the Analytics feature to hide from the child site admin. If so, then yes! It’s too easy to disable access and hide that feature completely from the child sites admin.

    You’ll just need to disable the Analytics feature for that specific role.

    Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Questions for Multisite’ is closed to new replies.