Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Daniel-Pablo's avatar

How to remove media library pro original photo?

thanks, am trying to remove media library pro original photo, I mean I want to make the upload of the image and convert it, then DELETE the original file, the files can be very heavy so I will just need to keep the converted images, how to do that?

Thanks in advance.

I want to write something LIKE this

$this->addMediaCollection('exam')->removeOriginal();

hope to make sense ----- the code so far...

public function registerMediaCollections(): void
	{
		$this->addMediaCollection('exam');
	}

    public function registerMediaConversions(Media $media = null): void
    {
      $this->addMediaConversion( 'thumb' )
      ->width(300)
      ->height(300)
      ->sharpen(8)
      ->performOnCollections( 'exam' );

      $this->addMediaConversion( 'C800' )
      ->width(800)
      ->performOnCollections( 'exam' );


  }
0 likes
4 replies
Daniel-Pablo's avatar

@tykus hi, I cant remove the original image, is there a way to specify on the code that I don't want the original image in my server...

mostoks's avatar

@arius Hello It's been so long Have you found a solution to this problem or not?

Daniel-Pablo's avatar

I did not continue with the development of this, so I never checked if something solved this case, for now I will mark as solved in the @tykus response

Please or to participate in this conversation.