sandywp / plugins / export-media-with-selected-content

Export media with selected content (by DKZR)

4.5 out of 5 stars. 4.5 93 reviews

Include all relevant attachments in your export.

Launch a sandbox with this plugin → No signup.
Ready in seconds.

v2.1.4 40,000+ installs WP 4.5+ PHP 7.0+

your-sandbox.sandywp.com/wp-admin
Export media with selected content (by DKZR) running inside a SandyWP sandbox

What you get inside

1 screen
  • "Export media with selected content" checkbox option now available in the Export screen.

About this plugin

When selecting one post type in the WordPress export screen, by default the linked media (attachments) are not included.

This plugin adds an “Export media with selected content” option. When checked, the plugin tries to find featured images and included media in the post_content, adding them to the export file.

Questions

Images seem to be missing in the export file

This plugin hooks into the WordPress export routine and tries to find images related to the post (page, etc.). It does so by looking for “attached” (uploaded to) media and it searches the body of the post (the post_content) for image files.

It’s possible that themes or plugins use different ways of referencing media to your post. This plugin will not find those.

The images are imported into the new site but eg. my galleries are broken

In eg. the Gutenberg gallery block, when you select an image size (for the gallery) the images with that size are ‘hard-coded’ in the html.

The WordPress import routine downloads the original image of the ‘export site’ and re-creates the configured image sizes. When your configured image sizes differ, you might end up with broken galleries.

So make sure both sites have the same image sizes configured. See the Media settings in both sites and check if themes or plugins use add_image_size() reference.

Can I (have somebody) extend this plugin?

Yes! The plugin features two filter hooks:
* export_query
* export_query_media_ids

Please browse the code to see what they do, I guess export_query_media_ids is easiest to use as it requires you to just add more attachment IDs to an array.

4.5

93 reviews

  • 5 ★ 78
  • 4 ★ 2
  • 3 ★ 3
  • 2 ★ 0
  • 1 ★ 10

Ratings come from WordPress.org. SandyWP does not collect its own reviews.

sandywp / also on the shelf

Try another plugin

Spin up a real WordPress site in seconds.

Test plugins, build a demo, hand a client a link — then squash it and start again. No local setup, no Docker.