---
title: "How to Export WordPress Media Library Files to CSV or Excel"
url: "https://wpimportexport.com/export-wordpress-media-library-to-csv-excel/"
description: "Export WordPress media URLs, alt text, captions, sizes and dimensions to CSV or Excel. Follow the admin steps or create an inventory with an AI agent."
type: post
published: 2026-08-16T12:18:32+00:00
modified: 2026-11-14T10:33:54+00:00
categories: ["Export Guides", "Video Lessons"]
tags: ["export WordPress media to CSV", "Import Export by RockStarLab", "media file audit", "WordPress CSV export", "WordPress Excel export", "WordPress Media Library export", "WordPress migration"]
docs_topics: ["Media workflows"]
---

# How to Export WordPress Media Library Files to CSV or Excel

The Media Library shows thumbnails, not a list you can sort by file size or missing alt text. In **Import Export by RockStarLab → Export**, choose **Media**, pick the attachment fields and download the file, one Media Library entry per row. For an image audit, start with the ID, file URL, alt text, width, height and size in bytes, and add the caption if an editor will review how images are described.

## Choose what belongs in the spreadsheet

| Task | Columns to keep | How to use them |
| --- | --- | --- |
| Find large images | File URL, MIME Type, File Size (bytes), Width, Height | Sort size from largest to smallest. Compare pixel dimensions with the space the image occupies on the page. |
| Review image descriptions | ID, Title, File URL, Alt Text, Caption | Filter to images and review empty alt text in the context where each image appears. A decorative image can intentionally have empty alt text. |
| Prepare a transfer | File URL, Title, Alt Text, Caption, Description | Keep source URLs reachable while the destination downloads the files. |

## 1. Select Media in the export wizard

Activate [Import Export by RockStarLab](https://wordpress.org/plugins/import-export-by-rockstarlab/), open its Export screen and select the Media card. Click **Next Step**. This reads attachments registered with WordPress. If files arrived by SFTP and are missing from Media → Library, first [register the uploaded files in the Media Library](https://wpimportexport.com/how-to-register-ftp-sftp-uploaded-files-in-the-wordpress-media-library/).

![Media selected in the WordPress export wizard](https://wpimportexport.com/wp-content/uploads/2026/11/wordpress-media-export-01-media-1.webp)

_Choose Media to work with attachment records._

## 2. Set the scope

For the whole library, leave the filters empty and note **Total items available**. If you only need part of the library, click **Add Filter**, select a field and condition, enter your value and check the resulting count. For a recurring report, keep a note of the condition so the next export covers the same population. See the [export filter examples](https://wpimportexport.com/wordpress-export-data-filters-examples-how-to-use-them-effectively/) for more combinations. If you already know the exact files you want, follow the guide to [exporting selected attachments](https://wpimportexport.com/export-selected-files-wordpress-media-library/).

![Media export filters and total available attachments](https://wpimportexport.com/wp-content/uploads/2026/11/wordpress-media-export-02-scope.webp)

_Leave the filters empty to include the full library._

## 3. Select and order the fields

Drag fields from **Available Fields** to **Export File Structure**. Use **Add all** beside a group to include that group, or the top-level Add all button for the full set. Arrange the columns in reading order. Put ID first when you plan to compare two exports. Titles can repeat, while each attachment on the same site has its own ID.

![Attachment fields arranged as export columns](https://wpimportexport.com/wp-content/uploads/2026/11/wordpress-media-export-03-fields.webp)

_The left column sets the order of the spreadsheet headers._

Choose **File URL** (`file_url`) for a link to the file. **File Path (Relative)** identifies its location relative to uploads. **File URL (GUID)** is a separate stored value and can still reference an earlier domain after a site move. Open a few file URLs before handing a migration sheet to another team.

**Attached To (Post ID)** identifies the attachment’s parent. An image can appear in a page, a template or a custom field even when the parent is empty. Review where a file is used before making a cleanup decision. For images stored inside ACF content, see [exporting ACF fields and image references](https://wpimportexport.com/how-to-export-wordpress-posts-pages-custom-post-types-with-acf-pro-fields/).

## 4. Download a CSV or Excel workbook

Click **Next Step** and select **CSV** for a delimited text file or **XLSX** for an Excel workbook. For CSV, leave the comma delimiter unless your receiving tool expects another separator. Keep **Include Header Row** enabled. Enter the file name without its extension. The optional `{job_id}` placeholder helps distinguish successive downloads.

![CSV delimiter, header row and file name options](https://wpimportexport.com/wp-content/uploads/2026/11/wordpress-media-export-04-format.webp)

_Include the header row so the first line identifies each field._

Click **Start Export**, wait for completion and download the export file. Open it in your spreadsheet application and compare the number of data rows, excluding the header, with the scope from step 2. If Excel displays the CSV in one column, import it as delimited text with the same separator you selected. For a native workbook, choose XLSX in the wizard.

![Completed Media export jobs in the WordPress Jobs Log](https://wpimportexport.com/wp-content/uploads/2026/11/wordpress-media-export-05-jobs.webp)

_Check the number processed against the scope you selected._

## Read the attachment report

Filter `post_mime_type` to image types before reviewing `width`, `height` or `alt_text`. A PDF and an image have different metadata. Sort `file_size` numerically to bring large files to the top. To display MiB in a separate spreadsheet column, divide the byte count by 1,048,576. Open an example in Media → Library and compare its URL, dimensions, caption and alternative text with the matching row.

The standard inventory contains URLs and metadata. To copy the actual files, use the spreadsheet as input to [import media from file URLs on the destination site](https://wpimportexport.com/import-wordpress-media-library-files/). For repeat transfers, review [media duplicate handling](https://wpimportexport.com/how-to-export-and-import-wordpress-media-files-without-duplicates/) before starting again.

## Export the Media Library with an AI agent

Connect your agent using the [WordPress Abilities API setup guide](https://wpimportexport.com/how-to-use-the-wordpress-abilities-api-with-ai-agents-exports-imports-content-sync-and-backups/). Ask it to inspect `rsl-ie/get-content-schema` for `media`, then give it the scope, format and columns. These prompts serve different tasks.

### Create an Excel inventory

> Export my entire WordPress Media Library to XLSX with a header row. Include ID, title, file URL, MIME type, file size in bytes, width, height, alt text and caption, in that order. Name it media-inventory-{job_id}. Wait for completion and give me the download link and the number of attachments exported.

The agent can start the export with `rsl-ie/export-start`, check its status with `rsl-ie/job-get` and retrieve the download link with `rsl-ie/file-get`. For XLSX, request `spreadsheet_include_header: true`. You can open the same job in the WordPress [Jobs Log](https://wpimportexport.com/how-to-use-jobs-log-and-schedule-wp-import-and-export-jobs/).

### Prepare an image audit before downloading

> Inspect the media export schema and preview up to five JPEG attachments with their ID, file URL, size, dimensions and alt text. Show me the columns before creating the CSV. After I approve them, export the matching JPEGs with a header row.

When reviewing the sheet, keep the attachment ID with each editorial note so someone can find the right image later. To reproduce the same inventory periodically, follow the guide to [scheduling repeated exports](https://wpimportexport.com/how-to-schedule-repeated-exports-in-wordpress/).

## Video walkthrough

This video shows an earlier version of the export wizard. Use the screenshots above for the current controls.

[Video: How to Export WordPress All Media Library Files to CSV or Excel](https://www.youtube.com/watch?v=5b9BuabK5xk)

## FAQ

### Can I export the WordPress Media Library to CSV?

Yes. Import Export by RockStarLab lets you export WordPress Media Library files to CSV, including file URLs and attachment metadata.

### Can I export WordPress media files to Excel?

Yes. You can export media file data to XLSX format for Microsoft Excel workflows.

### Can I filter media files before export?

Yes. You can add filters to export only specific media files, such as images wider than a certain number of pixels or files uploaded during a specific date range.

### Which media fields can I export?

You can export fields such as attachment ID, title, file URL, file type, MIME type, file size, width, height, alt text, caption, description, and upload date.

### Can I use the exported media file for migration?

Yes. The exported media file can be used later to import media files into another WordPress website.

## Related Guides

- [Export the Media Library with File Sizes to Find Large Images](https://wpimportexport.com/find-large-images-wordpress-media-library-file-sizes/)
- [Export Image Alt Text and Find Images Without It](https://wpimportexport.com/export-image-alt-text-find-missing/)
