WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I invoke the media uploader from a certain page, I'm looking for a way to hide all of the 'Gallery Settings' options at the bottom of the Gallery tab. I have set a referrer (dd-options-footer), so I can check that to ensure the code is only added for my desired page, but it seems that whatever I add does not work.

I've tried adding both custom CSS and JS to do this, but it appears that WP overrides this in wp-admin/js/gallery-min.js when it outputs the content of the tab.

Anyone know how I can do this? Thanks.

share|improve this question
up vote 0 down vote accepted

David, I'm not sure if you're trying to disable the whole gallery (plus the settings) or only its fields. For the first option, you should try do deregister the admin-gallery script:

function disable_gallery() {
    $post_id = (int) $_GET['post_id'];

    // Check for your post / page ID
    if( $post_id == 343  ) {
        wp_deregister_script( 'admin-gallery' );

add_action( 'admin_enqueue_scripts', 'disable_gallery' );
share|improve this answer

Your Answer


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.