How do I hide the editor from a custom post type, but retain the ability to access the media library?

I have registered a custom post type and created a meta box for it that allows users to upload files. However, if I remove support for the editor with the register_post_type function, the media library will no longer load.

  • You can use Adminimizeplugin that might help you.
    – Rishabh
    Jan 19, 2016 at 8:31
  • Can you post your code so we can reproduce the issue? Note that in most cases, no code = no question.
    – cybmeta
    Jan 19, 2016 at 8:53
  • Is it possible that, when removing (from the 'supports' array) the editor option, you don't see the "Add Media" button anymore because it belongs to TinyMCE?
    – Charles
    Jan 19, 2016 at 10:38
  • Well, actually, I still see the button, it just throws a Javascript error when it's clicked, saying that 'frames' is undefined. But I discovered that if I add thumbnail support to the supports array, the custom meta box can access the media library and the featured image box can be hidden via screen options which will work for me. Jan 19, 2016 at 21:38
  • @cybmeta, I thought it was something very simple that I was just missing that everyone else knew, not a specific problem with my code. I would post, but I found a solution that works fine for my purposes. I'll try to post code in the future. Jan 19, 2016 at 21:44

1 Answer 1


The media_upload_tabs filter passes a single argument containing an array of the tabs, you can unset() them to remove them.

The array looks something like this:

    [type] => From Computer
    [type_url] => From URL
    [gallery] => Gallery
    [library] => Media Library

to remove the media library tab:

function remove_media_library_tab($tabs) {
    return $tabs;
add_filter('media_upload_tabs', 'remove_media_library_tab');

If you only want to hide it on certain posts or post_types you can check the $_REQUEST or $_GET args. When using the 'Upload/Insert' links several points of data are passed along: /wp-admin/media-upload.php?post_id=28506&type=image&TB_iframe=1&width=640&height=581

function remove_media_library_tab($tabs) {
    if (isset($_REQUEST['post_id'])) {
        $post_type = get_post_type($_REQUEST['post_id]);
        if ('post' == $post_type)
        return $tabs;
add_filter('media_upload_tabs', 'remove_media_library_tab');

Hope that helps

  • Ehm, maybe my screen shows some different but this is what I read: but keep media library access .
    – Charles
    Jan 19, 2016 at 10:30
  • Thatnks for the response, but Charles is right, I'm looking to keep the media library. Jan 19, 2016 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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