Remove Category Base

add_action('init', 'remove_category_base');
function remove_category_base() {
    global $wp_rewrite;
    $wp_rewrite->category_base = '';
    $wp_rewrite->flush_rules();
}