Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How to disable categories/most used in 'add new post'? I tried function: remove_meta_box(), but it doesn't work for me, i tried it in functions.php for my theme, it's mistake?

share|improve this question
    
Do you want to remove the whole Categories box or only the Most used tab? –  brasofilo Oct 31 '12 at 0:07
    
@brasofilo - i wanted to remove the Most used tab and did it as above- look at next posts. –  user23188 Nov 1 '12 at 20:07
add comment

2 Answers 2

In Add New Post, click on the Screen Options tab om the top right then uncheck Categories. If you want to change it for all users, you can either:

  • sign-in as the user and then change their screen option
  • edit your theme's function.php. there are a couple options here and here that might work for you
  • try to see if this old plugin still works with your version of wordpress
share|improve this answer
    
Thanks for help-very useful is schema for arrays in wp_meta_boxes, but i used other way - just add: ul#category-tabs li.hide-if-no-js {display:none;} in wp-admin.css and it works. i dn't see yet if it causes any aside problems in other place but i hope no:) On the other hand i don't know why code "remove_meta_box()" doesn't work... –  Marcin Oct 30 '12 at 8:10
    
@Marcin, just be aware that CSS mod you made will be overwritten every time you update WP. –  Gaia Oct 30 '12 at 12:07
add comment

remove_meta_box removes the whole Categories box.

The Most used tab don't have any hook.

Don't modify WordPress core files, there's always a way to modify WP behavior without touching the core.

/**
 * Place the script in the theme's functions.php file
 */

add_action( 'admin_head-post-new.php', 'wpse_70874_hide_most_used_cats' );
add_action( 'admin_head-post.php', 'wpse_70874_hide_most_used_cats' );

function wpse_70874_hide_most_used_cats()
{
    // This function runs in all post types (posts, pages and cpts)
    // So we need to check for the correct type
    global $post;
    if( 'post' != $post->post_type )
        return;

    // If checking for a custom taxonomy, the <ul> id is 'custom-taxonomy-slug-tabs'
    // See /wp-admin/includes/meta-boxes.php, line 322, WP 3.4.2
    ?>
    <style type="text/css">
        #category-tabs .hide-if-no-js {display:none;}
    </style>
    <?php
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.