You can add the below code in the functions.php file of your current active theme to restrict vendor from accessing the WordPress backend:
function block_wp_admin() {
if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
wp_safe_redirect( home_url() );
exit;
}
}
add_action( 'admin_init', 'block_wp_admin' );
You can add the below code in the functions.php file of your current active theme to remove the “vendor backend access” option from the vendor dashboard:
add_filter('mvx_vendor_dashboard_header_right_panel_nav', function( $panel_nav ){
unset($panel_nav['wp-admin']);
return $panel_nav;
} );






