• Resolved millend

    (@millend)


    Hello,

    Is it possible to exclude an image from post gallery import – say I have column in csv with a comma separated list of image external URL’s – is it somehow possible to exclude the first image in the list somehow for all imported items?
    Problem is that that the csv is autogenerated each week and it’s impossible to do it by hand before the import. Is it viable on the import side somehow?

    Thank you in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hey @millend,

    I have column in csv with a comma separated list of image external URL’s – is it somehow possible to exclude the first image in the list somehow for all imported items?

    Yes, you can use a PHP function to do that: https://www.wpallimport.com/documentation/developers/custom-code/inline-php/. For example:

    [ltrim(substr({images[1]},strpos({images[1]},","),strlen({images[1]})),",")]

    Just replace {images[1]} with the actual import element that has the comma-delimited list of images.

    Thread Starter millend

    (@millend)

    Thank You so much @wpallimport Works like a charm!

    Anyone else looking for this hidden gem and the URL’s are separated by a tab then here’s a slightly altered code for this:

    [ltrim(substr({imagesurls[1]},strpos({imagesurls[1]},"|"),strlen({imagesurls[1]})),"|")]

    • This reply was modified 4 years, 8 months ago by millend.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exclude first image from csv media import – possible?’ is closed to new replies.