Our Digital Marketing Blog

A few news about DeMomentSomTres as well as news and tricks on Digital Marketing and Social Media management

WordPress export posts with attachments: our most recent new plugin

If you try to import a WordPress exports posts with attachments that’s is generated with any other filter than ‘all content’ attachments are lost.

This is not a big problem if you are dealing with small amounts of contents. But sometimes you need to import some of the contents from a very big WordPress site and you need to use filters based on post time, content type (post, page or any of the custom post types you use). In this kind of situation, WordPress standard export doesn’t work because as you filter, attachments are lost.

The need: a real case of wordpress export posts with attachments problem

During this week at DeMomentSomTres we have had to solve that situation. We where working on the new website of International School of Barcelona. The blog should be integrated into this web but it was hosted in another WordPress site in a diferent domain and hosting provider. This old blog had information since 2009 with a lot of attachments and images but we only needed last year. And to make it more difficult, there where many attachments and some of them very fat.

Our plugin prevents overloads
Our plugin prevents overloads if used with care 😉

The only true solution we found was to create our own WordPress plugin to generate a custom export file that includes required attachments.  Other options resulted in overload of the system and timeout errors either in export or import.

The need of the plugin was obvious so after having a look the WordPress repository of plugins and googling “WordPress export post with attachments” we decided to build it by our own.

Our WordPress export posts with attachments plugin

The plugin is based on WordPress Export API that is under documented but is quite short. So, the export file is a fully compliant WXR file.

After installing the plugin, WordPress standard post export procedure is modified in order to include attachments and images. The new export process includes in the resulting file only the required attachments and images.

As the plugin doesn’t modify any WordPress element as it uses hooks, it can be uninstalled without problems when you don’t need it.

This morning we have asked to include it on WordPress Plugins Repository but if you need to export post or custom post types with images or attachments you can download it from its specific page in our website.

Feel free to use it. We hope it is useful. What’s your opinion?

Credits: common content image from wikimedia

Comments

  1. Mary Fountain

    Hi – I realise this is the wrong forum for ‘mailchimp immediate send’ but I can’t see another post to add this comment to. It’s a very recent upload to WP I can see – I’ve downloaded it to my WP theme, but in the set up page, what I’m looking at is ‘general options’ ‘mailchimp API key’ – but no blank field is appearing to enter the API code into or anything else. Would you take a look please, the plug in description looks great, thanks a lot

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Archives