• Resolved barthdesigns

    (@barthdesigns)


    Hi there,

    With AI I’ve tried to put together a code to be able to do the followin.

    I would like to reproduce the same folder link structure as is on the original website where products were exported from.

    Like image 1 is in folder 2019/10. So on the new site this image 1 should be in the same folder. (Not all images in 2025/01 – as is current month)

    Tried to hook into the import process of WooCommerce. Reached the point where we could upload the file into a good fodler structure. But still, Woo uploads to 2025/01 and attaches this image isntead of the other one.

    Is there an easier way to accomplish this?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Zee

    (@doublezed2)

    Hello barthdesigns,

    Thank you for contacting WooCommerce support.

    I understand you want to maintain the original folder structure for imported product images, but WooCommerce still uploads them to the current month’s folder.

    Please note that custom code is not covered by our support policy.
    I recommend consulting a developer or posting your question in the Woo Community Slack for further guidance.

    Let me know if you have any questions.

    Best regards.

    Thread Starter barthdesigns

    (@barthdesigns)

    Hi there,

    Got it, tahnk you. No problem, solved the issue.

    But one issue remained – tested with a clean WordPress install as well and can’t figure out,

    I’ve exported just 3 products as a test from my original website. Then to an absolutely fresh WordPress where only WooCommerce is active, I went ahead and imported it.

    And for some reason the main product image got a -1 at the end of the image. ALthough – as mentioned, uploads folder and Media is completely empty, just like the database.

    Can you please let me know in what cases does this “-1” (and also saw scaled-1 or so as well) added, when no other image persists on server with the same filename?

    In CSV the filanames are good which I use for import.

    Thank you!!

    Hi @barthdesigns,

    It sounds like WordPress is appending -1 to the image filenames during import due to the way it handles media uploads. Even on a fresh install, this can happen for a few reasons. One possibility is that WordPress automatically scales images that exceed 2560px in width or height, appending -scaled to the filename. Another reason could be temporary file conflicts—WordPress creates temporary files during import, and if a file with the same name exists in the system, even if not visible in the Media Library, it may append -1 to prevent duplication. Additionally, there could be ghost files in the database or server cache interfering with the upload, even if the uploads folder appears empty.

    To work around this, you can try manually uploading the images via the Media Library before importing your CSV and then mapping the images using their URLs. Checking for any server-side caching and clearing it might also help.

    Thank you.

    Thread Starter barthdesigns

    (@barthdesigns)

    Thank you so much! I will take a closer look, you’ve helped a lot! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Product import tool: upload to same folder structure’ is closed to new replies.