# Optimize uploaded files

**URL:** <https://community.hubspot.com/t/optimize-uploaded-files/124841>\
**Category:** Tips, Tricks & Best Practices\
**Tags:** professional\
**Created:** [January 27, 2025, 5:05pm UTC](https://community.hubspot.com/t/optimize-uploaded-files/124841 "2025-01-27T17:05:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvarofranz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alvarofranz/32/63428_2.png) [@alvarofranz](https://community.hubspot.com/u/alvarofranz)\
**Post date:** [January 27, 2025, 5:05pm UTC](https://community.hubspot.com/t/optimize-uploaded-files/124841/1 "2025-01-27T17:05:26Z")

</div>

A fundamental best practice in modern times is to optimize images to use proper sizing, quality and format.

I need to automate this process, meaning: files uploaded to Content Hub should be automatically converted to webp and resized to a maximum width/height.

How do I achieve this?

Thanks!

---

<div class="post-metadata">

**Author:** ![kennedyp](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@kennedyp](https://community.hubspot.com/u/kennedyp)\
**Post date:** [January 27, 2025, 10:27pm UTC](https://community.hubspot.com/t/optimize-uploaded-files/124841/2 "2025-01-27T22:27:02Z")

</div>

Hey @alvarofranz! Thanks for the post. I understand you want all images uploaded to HubSpot to be automatically optimized. I assume this is a step beyond the [Automatic image resizing on HubSpot content](https://knowledge.hubspot.com/files/automatic-image-resizing-on-hubspot-content)that occurs by default, correct?

I want to invite some subject matter experts to see if they have any suggestions.

Hey @alyssamwilie, @RatulRahman, @Jnix284 do you have any best practices for automatic image optimization to these specs?

_Best,_

Kennedy

---

<div class="post-metadata">

**Author:** ![albertsg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/albertsg/32/99473_2.png) [@albertsg](https://community.hubspot.com/u/albertsg)\
**Post date:** [January 28, 2025, 1:52pm UTC](https://community.hubspot.com/t/optimize-uploaded-files/124841/3 "2025-01-28T13:52:19Z")

</div>

Hi @alvarofranz, I believe you would need to create a custom solution for this, most likely using some kind of image optimization API together with HubSpot’s Files API.  
AFAIK, HubSpot doesn’t support such behaviour other than the Automatic image resizing that @kennedyp mentions.  
You can also ask your team to use services such as [TinyPNG](https://tinypng.com/) before uploading files to HubSpot.  
And if you are worried about heavy images appearing in your website, you can always use the [resize\_image\_url](https://developers.hubspot.com/docs/reference/cms/hubl/functions#resize_image_url) function in your code.
