Perform a check to see if an external image URL is a 404

. asked 2 years ago

As the title says. If datafeedr has products where the image url leads to a 404 page, is there a way to detect this on import and assign the standard woocommerce placeholder in its place

1 Answers
Dave Hilditch Staff answered 2 years ago

This should be happening already in External Images.

  1. Check if the post/product has an external image, if so, display it
  2. Else, use the normal code which will grab uploaded images if they are there
  3. If no uploaded image, it runs the woo placeholder
  4. Inside the placeholder hooks, I do recheck if there is an external image – this is backwards compatibility code for our older users.

What are you actually seeing?

Ah – I think I understand now – you are saying at step 1 – there IS an image URL but the image URL fails and produces a 404.

I will add an option to the External Images page for a fallback image placeholder and then in there you can add the Woo placeholder image.

I’ve created a feature request for this here:

https://trello.com/c/vytWzBOb/161-add-image-fallback-option-for-when-external-image-404s

Your Answer


Super Speedy Plugins
Logo