Multiple Images

Johnathan Evans asked 4 years ago

I'm using the external images plugin with WP All Import for WooCommerce and I'm wanting to set multiple sources for the images. The problem is the remote source uses two different products numbers for the image name at times from two different fields in the CSV. I need to be able to make the plugin use the one that isn't going into a 404. Is it possible to get around this somehow? Thanks!

1 Answers
Dave Hilditch Staff answered 4 years ago

Yes – you can use the getimagesize PHP function to check if the remote image exists.

In your WP All Import, you should create a custom PHP function, then enter the function in the place where you would normally have the image – the external_image_url custom meta I presume. Pass the two image URLs as parameters.

Then inside the function, use the getimagesize function to check if image1 exists, if it does, return that string, otherwise return the other.


We publish performance optimisation guides regularly.

Subscribe so you never miss out.

We use cookies

We use cookies for various things on our site, including our on-site chat bubble (if you use it), our comment forms (if you use them) and for session handling (if you log in).

Other than that, we use cookies to identify where traffic came from to help us understand which traffic turns into sales, we use a cookie for Google Analytics traffic analysis and we use a cookie to customise adverts for our own products we think you'll be interested in.

You can read more detail in our privacy policy page. Please click 'Accept' or 'Decline' to continue.