about what I know and what interests me

WordPress attachment import/export issue – workaround

I exported the all my wordpress posts here using the Tools – export option. I later tried to import all the posts to my new domain (I shall announce soon). The import was only half successful. Pictures that form an integral part of my posts have been skipped.

And in fact there were errors like:

Remote file error: Remote server did not respond.


Remote file error: Remote file is incorrect size.

I then tried to debug the import mechanism on  wordpress-2.8.6. I found that there was not much of a problem with it.  The problem was actually with the export mechanism.

Here are my findings:

Post attachments are mentioned in the XML within the <wp:attachment_url> tag. The URL for one such picture attachment was something like:


When I tried to put this URL on the web-browser, it redirected to:


While the latter URL seems to be more direct form of accessing the attachments, the problem could be with resolving the relative URLs in wp_get_attachment_url() of wp-includes/post.php

The work around for now would be to perform a replace-all for with in the exported XML file. I have made sure that only the <wp:attachment_url> tag has such entries.

Hope this helps.

4 Responses to “WordPress attachment import/export issue – workaround”

  1. […] See the rest here: WordPress attachment import/export issue – workaround « My 1st Blog […]

  2. Iboong says:

    Dear Author !
    In my opinion you commit an error. I can defend the position. Write to me in PM, we will talk.

  3. I want to quote your post in my blog. It can?
    And you et an account on Twitter?

Please share your thoughts