Moe Loubani Software Developer / Development Consultant

Squarespace to WordPress Image Issues and a Fix

If anyone has tried to take a Squarespace site and import it into WordPress then you have come across the issue where the images are still linked externally to Squarespace. No problem, there are plugins like Import External Images that will load those all up for you, right? Well it wasn’t so easy for me and after scouring the internet for a fix I ended up modifying the Import External Images plugin so that it uses curl to download the images instead of WordPress’ download_url function which was giving me a forbidden error. After a little tinkering and tweaking of the headers sent with the curl request I finally came up with a solution that should work for anyone having the same issue. You can download it here: http://www.moeloubani.com/downloads/import-external-images-sqspc.zip

Let me know if it works (or doesn’t)!

Edit: updated to work with image urls ending in ?format=original (or any query string after the image name for that matter).

5 Comments

    Jordan

    Jordan

    This worked great for inline images! Any chance of making it work for a post’s featured images as well? I’m importing a site from Squarespace where the majority of images are failing to import using the WordPress import tool due to 403 errors, but they’re all featured images.

    Reply
      Moe Loubani

      Moe Loubani

      I’ll make a note of this and maybe I’ll be able to come up with something in the future that does it

      Reply
    Kate

    Kate

    Hi Moe, THANK YOU! This worked like a dream for me.

    Reply
    Kristen

    Kristen

    Unfortunately it just keeps uploading the same image over and over for me. So now I have 250 posts with the same image over and over. Any fix?

    Reply
      Moe Loubani

      Moe Loubani

      Hello Kristen, not sure what could be causing that but I’d say a good first step is to check the export file. Does it have the images repeated in there?

      Reply
    John D

    John D

    Currently struggling with a large volume of images still being hosted on squarespace after a migration. Issue mainly being the mixed content message which I get when loading my old posts…
    So this plug-in seemed ideal!

    However, when I uploaded these files and attempted to activate the plug-in I got a fatal error on line 65 of the PHP file…has there been any update since? Also, can it be published on WordPress so it’s easier to find/install?

    FYI, I had the original import external images installed if this makes any difference.

    Thanks,
    John

    Reply
      Dan

      Dan

      Same error for me.
      Plugin could not be activated because it triggered a fatal error.

      Fatal error: Cannot redeclare external_image_admin_init() (previously declared in /home3/ameridm4/public_html/rissfloral/wp-content/plugins/import-external-attachments/import-external-attachments.php:57) in /home3/ameridm4/public_html/rissfloral/wp-content/plugins/import-external-images/import-external-images.php on line 65

      Reply
    Christian Peterson

    Christian Peterson

    Oh man testing this out now. We have many clients making this move.

    Reply
      Moe Loubani

      Moe Loubani

      Thanks! Please let me know how it goes!

      Reply