my code

Tobias Hopp

Remove custom capabilities
by Tobias Hopp

Remove custom capabilites which you may have entered for whatever and don't want to use then any more.

See this page:

Snippet options

Download: Download snippet as remove-custom-capabilities.php.
Copy snippet: For this you need a free my code account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!


add_action( 'admin_init', 'clean_unwanted_caps' );
function clean_unwanted_caps(){
    // Enter the capabilites in this array
	$delete_caps = array('edit_issues', 'publish_issues', 'edit_other_issues', 'read_private_issues',
		'delete_issue', 'edit_issue');
	global $wp_roles;
	foreach ($delete_caps as $cap) {
		foreach (array_keys($wp_roles->roles) as $role) {
			$wp_roles->remove_cap($role, $cap);

Create a free my code account now.

my code is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.