CMS Development

jcporcel
Participant

Bulk image replacement on posts

SOLVE

My company has a couple hundred blog posts with images that sometimes are either pngs or other large images. I wanted to know if there was some option to replace them in bulk. Something like replacing a complete folder full of images or other way to overwrite the current images whitout having to use the "Relace" option individually in each one on the File section of hubspot (or going into each post to change them).
Thanks!

0 Upvotes
1 Accepted solution
Jnix284
Solution
Most Valuable Member | Diamond Partner
Most Valuable Member | Diamond Partner

Bulk image replacement on posts

SOLVE

Hi @jcporcel Having been through many changes with HubSpot File Manager and seeking similar capabilities, the only way I have found is by breaking all of the images and loading replacements in their place.

Here's what I mean:

 

Essentially, you prep all of the images you need to replace ahead of time - let's say you have 100 images that you've optimized with tinypng.com and you want to swap them out with the existing files that are in 2 different folders.

 

I've done this before, but please do a test with a handful of images on a test page before you batch replace hundreds at a time. 🙂

 

0. Export all files in a zip - this will give you a local copy of the file structure and file names that you can work with

1. the file name and extension of your new files must be identical to what's in File Manager

2. the folder name can't change during this process and you need to sort your replacement files using the same structure

3. open the first folder with images you want to replace and delete them, let's say that's 40 images in the folder, you'd have to go through and only pick out the ones you are replacing (unless you're lucky/smart and are replacing all of them).

4. your images on existing blogs, pages are now broken - so be quick about this next part, you'll want to do these steps back to back

5. in the same folder, load the new images in their place (because you deleted the files with the same name, HubSpot won't automatically append the -1 extension)

6. the blog images will fix themselves because the file is back in its place, it may not recognize the file size change immediately (odd, but true) and you can use the server side cache buster to verify all is good
(add ?hsCacheBuster=257 with random number to end of URL)

7. repeat steps 3-7 for each folder you need to replace images in

 

As I said before the steps, please test with a smaller set of images so you don't come back and yell at me that it didn't work 😉 I haven't had to do this in several months and with HubSpot things change all. the. time.


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

View solution in original post

4 Replies 4
MMark0
Member

Bulk image replacement on posts

SOLVE

Thank you for bringing up your query about replacing images in bulk on your company's blog posts. It can be quite time-consuming to individually replace images in each post, especially when dealing with a large number of blog tech posts. Fortunately, there are options available to streamline this process and make it more efficient. One approach you can consider is using automation or a script to replace images in bulk. By writing a script or using a tool specifically designed for this purpose, you can specify the folder or directory containing the new images and automatically overwrite the existing images across multiple posts. Another option is to utilize content management systems (CMS) or blogging platforms that offer bulk image replacement functionalities. Depending on the platform you are using, there might be built-in features or plugins available that allow you to replace images across multiple posts simultaneously.

0 Upvotes
Jnix284
Solution
Most Valuable Member | Diamond Partner
Most Valuable Member | Diamond Partner

Bulk image replacement on posts

SOLVE

Hi @jcporcel Having been through many changes with HubSpot File Manager and seeking similar capabilities, the only way I have found is by breaking all of the images and loading replacements in their place.

Here's what I mean:

 

Essentially, you prep all of the images you need to replace ahead of time - let's say you have 100 images that you've optimized with tinypng.com and you want to swap them out with the existing files that are in 2 different folders.

 

I've done this before, but please do a test with a handful of images on a test page before you batch replace hundreds at a time. 🙂

 

0. Export all files in a zip - this will give you a local copy of the file structure and file names that you can work with

1. the file name and extension of your new files must be identical to what's in File Manager

2. the folder name can't change during this process and you need to sort your replacement files using the same structure

3. open the first folder with images you want to replace and delete them, let's say that's 40 images in the folder, you'd have to go through and only pick out the ones you are replacing (unless you're lucky/smart and are replacing all of them).

4. your images on existing blogs, pages are now broken - so be quick about this next part, you'll want to do these steps back to back

5. in the same folder, load the new images in their place (because you deleted the files with the same name, HubSpot won't automatically append the -1 extension)

6. the blog images will fix themselves because the file is back in its place, it may not recognize the file size change immediately (odd, but true) and you can use the server side cache buster to verify all is good
(add ?hsCacheBuster=257 with random number to end of URL)

7. repeat steps 3-7 for each folder you need to replace images in

 

As I said before the steps, please test with a smaller set of images so you don't come back and yell at me that it didn't work 😉 I haven't had to do this in several months and with HubSpot things change all. the. time.


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

jcporcel
Participant

Bulk image replacement on posts

SOLVE

This sounds pretty much exactly what I needed. I thought there was some sort of internal file reference system with ids like in google drive. But if everything is based on file names, this will probably fix our problem. Thanks! 

0 Upvotes
Jnix284
Most Valuable Member | Diamond Partner
Most Valuable Member | Diamond Partner

Bulk image replacement on posts

SOLVE

@jcporcel nope, no IDs, HS pulls the images in through their URL, which is why the paths and file names can't change.


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes