Is there an extension, or a technique, during Wordpress import to pull in an attachment URL that doesn't have a file extension?

I'm trying to import a Square Space blog into Wordpress. Most of the posts and URLs come over, but there's a small number (eight), where the images can't be imported. The importer fails with a message like

Failed to import Media “attachment-50b1b915e4b01c11f0ef7db4”: Invalid file type

If I lookup the attachment-50b1b915e4b01c11f0ef7db4 attachment in the XML import file, I find the following item node set

  <pubDate>Sun, 25 Nov 2012 06:22:13 +0000</pubDate>
  <wp:post_date>2012-11-25 06:22:13</wp:post_date>
  <wp:post_date_gmt>2012-11-25 06:22:13</wp:post_date_gmt>
  <dc:creator>[email protected]</dc:creator>

Zooming in on the attachment URL, that's


There's no file extension on this URL. It appears that the wordpress-importer plugin checks the file types of the URL by extension, using the wp_get_mime_types function.

Is there a way to work around this by mapping via the Content/Type header, or manually mapping specific URLs to specific file types during import?

1 Answer 1


With no native solution popping up here, I ended up writing a script that

  • Parsed my the XML import file I had and identified problem attachments
  • Manually download those attachments with a file extension
  • Upload those images to a new web server
  • Alter the appropriate link and wp:attachment_url nodes to point to the new URLs
  • Re-save the XML

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.