Tehnika Media Exporter

Descripción

Tehnika Media Exporter extracts media from your WordPress library with precision. Instead of dumping everything, it lets you target media by how it is used on your site — and it keeps working when your library has tens of thousands of files.

Every export runs as a sequence of short server batches rather than one long request, so PHP time limits and memory limits stop being a problem. The finished archive is streamed to your browser in chunks, never loaded into PHP memory.

What it does

Three ways to scope an export

  • The whole library — every attachment, narrowed by file type, uploader and date range.
  • Media used by specific content — start from posts, pages or any public custom post type, narrow them by category, tag and post status, then follow the featured image, the files uploaded to the post, the images embedded in its body, or any combination.
  • Unreferenced media — attachments that no post, page, featured image, gallery or site option points at. A ready-made cleanup audit.

Five output formats

  • ZIP archive — the actual files, with an optional folder structure (flat, by upload date, or by media type), an optional manifest.csv inside the archive, and optional inclusion of the generated thumbnail/medium/large versions. Duplicate file names are prefixed with their attachment ID so nothing is silently overwritten.
  • URL list — one direct file URL per line, ready for wget -i or curl.
  • CSV manifest — a spreadsheet of every file: ID, name, URL, MIME type, size, dimensions, upload date, author and parent post.
  • JSON manifest — the same data for scripts and migrations.
  • WXR XML — a WordPress import file containing the selected attachments and their metadata.

Built for real libraries

  • Batched, resumable exports. Progress is stored on the server, so a huge export survives a page reload — and it can be downloaded again later from Recent exports.
  • Honest progress. A live percentage based on bytes and file counts, with the number of files processed and any that were missing.
  • Preview before you commit. Count, total size and a breakdown by file type, without building anything.
  • Searchable pickers. Category, tag and uploader fields search through AJAX, so a site with 20,000 terms still opens instantly.
  • Cached analytics. Library breakdown, uploads per month, top uploaders and an unreferenced-media scan.
  • WP-CLI. wp tme export runs the same engine from the command line for very large jobs.

Accurate usage detection

Most exporters look for a single pattern. This one recognises:

  • Gutenberg block attributes — wp:image, wp:gallery, wp:cover, wp:media-text and anything using id, ids, mediaId or attachmentId
  • Classic editor markup — wp-image-123 classes, wp-att-123 links and attachment_123 caption IDs
  • Shortcodes that carry IDs — [gallery], [playlist], [album], [slideshow], [carousel]
  • Query strings such as ?attachment_id=123
  • With deep scan enabled: raw src, srcset and lazy-load URLs, resolved back to attachment IDs through a bulk uploads index

About the Author

Maintained by Tehnika, a creative digital agency working with remote teams and WordPress. We built this to solve our own migration headaches and decided to share it.

Use cases

  1. Migrating content — move selected posts to another site together with the images they actually use.
  2. Backups — download everything uploaded by a specific author last month, as a ZIP.
  3. Auditing — get a CSV of every document in a category, with sizes and parent posts.
  4. Housekeeping — find media nothing references any more before you clean it up.
  5. Automation — drive exports from WP-CLI in a deployment or archiving script.

Capturas

Instalación

  1. Upload the plugin files to /wp-content/plugins/tehnika-media-exporter, or install it through the WordPress plugins screen.
  2. Activate the plugin.
  3. Go to Tools Tehnika Export.

The export folder lives at wp-content/uploads/tme-exports/. It is created automatically and blocked from direct web access; downloads always go through WordPress so the permission check cannot be bypassed.

Preguntas frecuentes

Does this plugin require any server extensions?

ZIP export needs the PHP zip extension. Everything else — URL list, CSV, JSON and XML — works without it. If ZIP is unavailable the plugin tells you so on its screen and greys the option out.

How large an export can it handle?

The plugin no longer holds an archive in PHP memory, and it works through the file list in small batches, so exports are bounded by disk space rather than by memory or execution limits. If a host is unusually strict, lower Files per batch and Seconds per batch on the Settings tab; the export simply takes more requests.

Where do finished exports go?

Into a protected folder inside your uploads directory, for as long as you configure (24 hours by default). They can be downloaded again from Recent exports, and are then swept automatically. Nothing is left behind after that.

Can I export media from custom post types?

Yes. Every public post type is detected automatically and appears in the post type filter.

What counts as “embedded” media?

Anything referenced inside the post body — block attributes, shortcodes, classic editor markup and image IDs in URLs. Enable deep scan to additionally match images that are only referenced by their file URL, which catches most page-builder output.

Are unpublished posts included?

By default only published content is scanned, so drafts and scheduled posts do not leak media into an export. Add those statuses explicitly in the post status filter when you want them.

Is anything deleted by this plugin?

No. It only reads your media library and writes export files. Unreferenced media is reported as a candidate list; deleting anything remains your decision.

What happens when I uninstall it?

Nothing is removed unless you tick “Delete settings, log, presets and the export folder when the plugin is uninstalled” on the Settings tab. That is off by default.

Reseñas

No hay reseñas para este plugin.

Colaboradores y desarrolladores

Este software es de código abierto. Las siguientes personas han contribuido a este plugin.

Colaboradores

Traduce “Tehnika Media Exporter” a tu idioma.

¿Interesado en el desarrollo?

Revisa el código, echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios

2.0.0

  • New: exports now run in resumable server-side batches, so large libraries no longer hit PHP time or memory limits.
  • New: finished archives are streamed to the browser in 256 KB chunks instead of being loaded into PHP memory. This fixes a hard failure on libraries where the archive exceeded the memory limit.
  • New: Preview selection reports the file count, total size and a per-type breakdown before anything is built.
  • New: CSV and JSON manifest formats.
  • New: Unreferenced media scope for cleanup audits.
  • New: saveable filter presets.
  • New: WP-CLI commands — wp tme export, wp tme stats, wp tme unused.
  • New: ZIP folder structures (flat, by upload date, by media type) and an optional manifest.csv inside the archive.
  • New: option to include generated thumbnail, medium and large files alongside the originals.
  • New: export log, and stored archives that can be downloaded again from Recent exports.
  • New: filterable term and uploader pickers that search through AJAX, so large sites open instantly.
  • New: cached library analytics with a budgeted uploads-folder measurement.
  • New: tme_source_post_args, tme_referenced_media_ids and tme_attachment_path filters for developers.
  • Performance: featured images are resolved with one indexed query per batch instead of one query per post.
  • Performance: post bodies are fetched as ID and post_content only, instead of loading complete post objects to run a regular expression over one column.
  • Performance: every IN (…) clause is chunked, so six-figure libraries cannot overflow the query string.
  • Performance: each export batch primes the post, meta and user caches once, removing per-item database hits from every writer.
  • Performance: the analytic counts run as single queries; the directory measurement is time-budgeted and degrades to a partial figure instead of hanging.
  • Improved: embedded-media detection now understands Gutenberg block attributes, [gallery]/[playlist]/[slideshow] shortcodes, classic caption IDs and ?attachment_id= query strings. Previously only the wp-image-N class was matched.
  • Improved: deep scan resolves src/srcset/lazy-load URLs to attachments through a bulk uploads index rather than one lookup per URL.
  • Improved: duplicate file names inside an archive are prefixed with their attachment ID instead of overwriting each other.
  • Improved: unreferenced-media detection accounts for the site icon, the site logo, the theme logo and any plugin-registered references.
  • Improved: the interface is fully keyboard navigable, uses ARIA tab and combobox patterns, announces progress to screen readers, and replaces alert() with inline toasts.
  • Improved: the admin screen follows your WordPress admin colour scheme.
  • Improved: ZIP archives are browsable and readable again — the previous progress overlay could not be dismissed and blocked the page.
  • Fixed: the readme listed tehnika.mk as a contributor, but that is not a WordPress.org account, so the plugin page showed no author.
  • Fixed: the screenshot asset was uploaded as screenshots-1.png, which WordPress.org does not recognise, so no screenshot ever rendered.
  • Fixed: the tools screen and its assets are only loaded on the plugin’s own page.
  • Tweak: requires WordPress 5.6 and PHP 7.4.
  • Tweak: the export folder is created with index.php and .htaccess guards and is never web-accessible; downloads are capability-checked on every request.
  • Tweak: temporary export files are swept hourly and again on demand.

1.0.8

  • Enhancement: Complete UI overhaul with a modern, card-based interface.
  • Enhancement: Improved user experience with clear selection states and better layout.

1.0.7

  • Fix: Replaced deprecated seems_utf8 function with wp_is_valid_utf8 to ensure future compatibility.

1.0.6

  • Fix: Removed dependency on core export.php file to comply with WordPress Plugin Guidelines.
  • Fix: Moved JavaScript and CSS to external files and implemented wp_enqueue_scripts for better performance and security.
  • Tweak: Updated XML generation to use local CDATA formatting.

1.0.5

  • Maintenance release.

1.0.4

  • New: Added progress bar and loading overlay to improve UX during large exports.
  • Fix: Resolved security warning regarding sanitization of post type input arrays.
  • Tweak: Improved internal file handling for ZIP generation.

1.0.3

  • Added XML export format support.

1.0.0

  • Initial release.