WordPress – Disable image full size option

Is there any way in WordPress to prevent content editors from selecting the “Full size” option when inserting images to a post? I’ve already tried WordPress Prevent Users from posting full size image uploads but one this doesn’t seem to be working (last active in 2010).

Related posts

3 comments

  1. You should be able to filter out that option:

    function add_image_insert_override($size_names){
    
        //default array with hardcoded values for add_image_size
        $size_names = array(
                          'thumbnail' => __('Thumbnail'), 
                          'medium'    => __('Medium'), 
                          'large'     => __('Large'),
                          //'full'      => __('Full Size')
                        );
    
      return $size_names;
    
    };
    
    add_filter( 'image_size_names_choose', 'add_image_insert_override' );
    

    This gist goes into a little more detail.

  2. Here is my solution.

    function sgr_filter_image_sizes( $sizes) {
    
        unset( $sizes['thumbnail']);
        unset( $sizes['medium']);
        unset( $sizes['large']);
    
        return $sizes;
    }
    add_filter('intermediate_image_sizes_advanced', 'sgr_filter_image_sizes');
    

Comments are closed.