Add a custom user role

Add a custom user role

Sometimes, you might need to assign a custom role to your registered users. To do it, just add this to your functions.php file:
add_role(
	'my_role',
	'My Role',
	array(
		'read'              => false,
		'create_posts'      => false,
		'edit_posts'        => false,
		'edit_others_posts' => false,
		'publish_posts'     => false,
		'manage_categories' => false,
	)
);

Add a custom user role with no capabilities… or the ones you want to give it.
👨‍🦱👩