WordPress 2.9.1
Create admin-script.js in theme folder and edit:
jQuery(document).ready(function($){
$('.cat-checklist')
.prepend(
'<li><label class="selectit"><input value="1" type="checkbox" name="remove_categories" id="remove_categories"/> Remove Checked Categories</label></li>'
);
});
functions.php:
function my_enqueue() {
wp_enqueue_script('my_admin_script', get_bloginfo('template_url') . '/admin-script.js', array('jquery'), false, true);
}
add_action('admin_init', 'my_enqueue');
function my_bulk_edit($action, $result){
if('bulk-posts' == $action && isset($_GET['remove_categories']) && isset($_GET['post_category'])){
if(($_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']))){
$post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']);
$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
}
if('edit' == $doaction){
if(isset($_GET['post_type']) && 'page' == $_GET['post_type']){
if(! current_user_can('edit_pages'))
wp_die( __('You are not allowed to edit pages.'));
} else {
if(! current_user_can( 'edit_posts' ))
wp_die( __('You are not allowed to edit posts.'));
}
$post_IDs = array_map('intval', (array) $_GET['post']);
if(is_array($_GET['post_category']) && ! empty($_GET['post_category'])){
$remove_cats = array_map('absint', $_GET['post_category']);
unset($_GET['post_category']);
foreach($post_IDs as $post_ID){
if(wp_check_post_lock($post_ID)) continue;
$cats = (array) wp_get_post_categories($post_ID);
$post_data['post_category'] = array_diff($cats, $remove_cats);
$post_data['ID'] = $post_ID;
wp_update_post($post_data);
}
}
}
}
}
add_action('check_admin_referer', 'my_bulk_edit', 10, 2);
Check ‘Remove Checked Categories’ and categories you want to remove!