wordpress snippets last updated   : January 29, 2015
we now have 646 snippets

Restrict wp-admin access to subscribers

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will restrict wp-admin access to subscribers.

snippet :  PHPcopy
	function restrict_access_admin_panel(){
		global $current_user;
		if ($current_user->user_level <  4) {
			wp_redirect( get_bloginfo('url') );
	add_action('admin_init', 'restrict_access_admin_panel', 1);
source →

Did you like this post? If so please share it with your friends. Thanks!