---
title: "How to Import WordPress Media Library Files from Another Website"
url: "https://wpimportexport.com/import-wordpress-media-library-files/"
description: "Learn how to import WordPress Media Library files from another website using a CSV or Excel file with Import Export by RockStarLab. Import images, videos, PDFs, and attachments into WordPress."
type: post
published: 2026-08-16T12:41:04+00:00
modified: 2026-11-04T09:28:28+00:00
categories: ["Import Guides", "Media Import", "Video Lessons"]
tags: ["Import Export by RockStarLab", "import WordPress media files", "WordPress CSV import", "WordPress Excel import", "WordPress Media Library import", "WordPress media migration"]
docs_topics: ["Media workflows"]
---

# How to Import WordPress Media Library Files from Another Website

To import images from URLs into WordPress, put the direct file URLs in a CSV, select **Media** in Import Export by RockStarLab, map the URL and metadata columns, and run the import. The plugin downloads the files and creates attachments in the destination Media Library.

This updated tutorial covers both an exported media list from another WordPress site and a small CSV you prepare yourself. You will import three images through the WordPress admin, check their actual files and metadata, and repeat the operation through an AI agent without creating duplicate attachments.

This guide uses the version 2.0 interface. Media import and the Free-namespace abilities used here are available in the free plugin.

## Choose the right image import workflow

Downloading an image is only one part of some migrations. Creating a Media Library attachment does not automatically make it a product gallery image or the featured image of a post.

| Your goal | Workflow | Result to verify |
| --- | --- | --- |
| Download image URLs from a CSV into WordPress | Media import, shown below | Local file, attachment and media metadata |
| Copy a selection from another site’s Media Library | Export its media list, then import it on the destination | Source URLs remain reachable during import; destination files open |
| Set post featured images | Post import with the supported image fields, or assign an imported attachment in the editor | The correct post references the correct destination image |
| Populate product images and galleries | WooCommerce product import or product sync | Product image, gallery order and variation images |
| Register files already uploaded by FTP | Media Sync / folder registration | Existing server files appear in the Media Library |
| Extract article text from web pages with AI | AI URL Importer | Extracted content in the intended post fields |

For server files, follow our [FTP/SFTP media registration guide](https://wpimportexport.com/how-to-register-ftp-sftp-uploaded-files-in-the-wordpress-media-library/). For store assets, see [importing WooCommerce products from CSV or Excel](https://wpimportexport.com/how-to-import-woocommerce-products-from-csv-or-excel/) and [importing variable products](https://wpimportexport.com/how-to-import-woocommerce-variable-products-from-csv/). Those are separate relationship checks; this Media tutorial does not test automatic assignment to products or posts.

## Before importing images from URLs

- Install and activate [Import Export by RockStarLab](https://wordpress.org/plugins/import-export-by-rockstarlab/) on the destination.
- Use direct image URLs that the destination server can download. A page containing an image, a cloud-drive sharing page and a direct file are different resources.
- Keep the source online until the download and destination verification are complete.
- Check disk space and WordPress upload permissions. Thumbnail generation adds files beyond the originals.
- Use images you own or have permission to copy.
- Take a [backup before changing an existing site](https://wpimportexport.com/how-to-create-a-wordpress-website-backup-and-restore-it/), especially when updating media metadata used elsewhere.

Opening a URL in your own browser does not prove that the WordPress server can fetch it. A signed-in browser may have cookies that the importer does not. Expiring links, hotlink protection, authentication and source-server limits can prevent downloads.

## Step 1: Prepare a CSV with image URLs and metadata

If the files already belong to another WordPress site, start with our [Media Library export guide](https://wpimportexport.com/export-wordpress-media-library-to-csv-excel/). An export provides the URLs and saved metadata without requiring you to rebuild the list manually. The source files still need to be available: a URL in a CSV is a reference, not an embedded copy of the image.

For a hand-made file, use one image per row and the following five columns:

| CSV column | Purpose | WordPress mapping |
| --- | --- | --- |
| `file` | Direct downloadable file URL | File URL |
| `title` | Readable name for the attachment | Title |
| `alt_text` | Alternative text describing the image in context | Alt Text |
| `caption` | Saved media caption | Caption |
| `description` | Longer attachment description | Description |

```
file,title,alt_text,caption,description
https://example.com/uploads/blue-backpack.jpg,Blue backpack,Blue backpack viewed from the front,Blue backpack front view,Front view for the product photo collection.
```

The example.com URL above is illustrative; replace it with a real image address. You can also [download our three-row media import sample CSV](https://wpimportexport.com/static/wordpress-media-url-import-sample.csv). It uses screenshots from our public site so you can inspect the source URLs before importing.

Save the file as UTF-8 CSV. Keep the header row. Let your spreadsheet application quote values containing commas or line breaks; manually adding an unquoted comma to a caption creates another CSV column. Start with a few rows and check the preview before processing a full collection.

Leave source attachment IDs out of a simple custom file. IDs belong to a particular WordPress database. Copying an ID from one site does not establish a reliable relationship to a post or image on another site.

## Step 2: Select Media and upload your file

1. Open **Import Export by RockStarLab → Import**.
2. Choose **Media**, then click **Next Step**.
3. Click **Select File** and upload the CSV.
4. Keep the comma delimiter for the supplied sample and leave **First row contains column names** enabled.
5. Continue to **Preview Data**.

Do not choose AI URL Importer for a CSV of image addresses. That tool extracts page content with AI; Media is the destination type for attachment records.

In the preview, check the row count, column boundaries and exact URLs. The sample has three rows and five columns. If the entire row appears in one cell, correct the delimiter before proceeding. If a heading appears as a data row, review the header setting.

![Media import preview shows three image URLs and five metadata columns](https://wpimportexport.com/wp-content/uploads/2026/10/media-v2-01-preview.webp)

_The preview separates file URLs, titles, alt text, captions and descriptions before anything is imported._

## Step 3: Map the CSV columns to media fields

Click **Auto Map**, then inspect every connection. Review all five fields. The visible destination names are File URL, Title, Alt Text, Caption and Description.

The mapping summary uses internal keys: `file_url`, `post_title`, `alt_text`, `post_excerpt` and `post_content`. That is expected: WordPress stores the caption in the attachment excerpt and the description in its content field.

If your headers are named differently, drag each source column to the appropriate destination field. A column named `photo_address`, for example, belongs in File URL, not Title. Check that the URL field is mapped before starting the import.

![Media field mapping connects file, title, alt_text, caption and description to WordPress fields](https://wpimportexport.com/wp-content/uploads/2026/10/media-v2-02-mapping.webp)

_Auto Map connected all five columns. Review the mapping instead of assuming a recognized header guarantees the intended result._

## Step 4: Set duplicate handling and batch size

For this workflow, select **File URL** under **Check for Existing Items by Field**. Choose **Update** when a match is found and **Create** when no match is found. This makes the initial run create missing attachments and lets a later run update matched metadata.

| Option | Use it when | What to check |
| --- | --- | --- |
| Update matching items | You want incoming metadata applied to existing matches | The same attachment IDs remain and intended fields change |
| Skip matching items | You want existing attachments left alone | Skipped counts are expected, not missing downloads |
| Create matching items | You deliberately need separate records | Whether duplicate attachments are actually desirable |

Choose Update/Create to update matches and add missing media. A batch size of one can help with large images, but file size, image dimensions and server limits still matter.

Keep **Replace links** off unless you have a specific transformation to apply. Rewriting a source image URL to the destination domain before the file exists there can point the downloader at a missing resource.

![Import options use File URL matching, Update for matches, Create for new records and batch size one](https://wpimportexport.com/wp-content/uploads/2026/10/media-v2-03-options.webp)

_These options were used for the initial three-image import. The agent repeat used the same matching policy._

## Step 5: Run the import and check the Media Library

Click **Start Import** and wait for completion. Review created, updated, skipped and failed counts.

![Completed media import reports three created items and zero failures](https://wpimportexport.com/wp-content/uploads/2026/10/media-v2-04-completed.webp)

_The UI confirms the initial creation result. The checks below verify that those records contain usable files._

Now open **Media → Library**. Search for your sample titles and open the attachment editor. Check all of the following:

1. The image renders rather than showing a broken preview.
2. The File URL belongs to the destination site.
3. The title, alt text, caption and description match the input.
4. The file type and dimensions look correct.
5. The downloaded original exists and opens.
6. A repeated import keeps the intended attachment identity.

![WordPress Edit Media shows imported alternative text, caption and description](https://wpimportexport.com/wp-content/uploads/2026/10/media-v2-05-editor.webp)

_The saved metadata matches the CSV after the admin import. The colorful image above it is the sample asset being imported, not the new plugin interface._

The sample files are intentionally screenshots from an older lesson. Treat the surrounding destination WordPress screens as the current workflow; the interface pictured inside each imported image is just file content.

Attachments without a parent post appear as unattached. That is a valid result for a Media Library import. “Unattached” does not mean the image failed to download. The [WordPress Media Library documentation](https://wordpress.org/documentation/article/media-library-screen/) explains the list view and attachment details.

## Repeat the import without creating duplicate attachments

Make a copy of the CSV and change only the captions. Keep the same file URLs and the same Update/Create matching settings. Run the copy as a new import, then compare attachment IDs and captions.

Updating metadata does not necessarily replace image bytes behind an unchanged URL. A changed URL, duplicate filenames from unrelated sites, CDN transformations and deliberately duplicated records need their own checks. For more background, see our [media duplicate-handling guide](https://wpimportexport.com/how-to-export-and-import-wordpress-media-files-without-duplicates/).

![Media Library list shows exactly three sample attachments after the agent repeat](https://wpimportexport.com/wp-content/uploads/2026/10/media-v2-07-library.webp)

_The repeated import retained the three existing records instead of adding another set._

## Import images from CSV with an AI agent

An MCP-compatible agent can coordinate the same Media import using the plugin’s WordPress abilities. The agent does not need to generate images or extract page text. It uploads the CSV, inspects the schema, validates the mapping, starts an import and reads the result.

First configure the connection using our [WordPress AI-agent setup guide](https://wpimportexport.com/how-to-use-the-wordpress-abilities-api-with-ai-agents-exports-imports-content-sync-and-backups/). Connect to the intended destination site and enable the plugin’s Abilities API. Use the free `rsl-ie` namespace for this Media workflow.

### Prompt 1: inspect the file and prepare the mapping

```
Connect to my destination WordPress MCP server.
Discover the Media import abilities and read their input schemas.
Inspect the attached CSV: it should contain three image rows with
file, title, alt_text, caption and description columns.
Upload it using the supported upload workflow, then prepare a Media import.
Show the source URLs, proposed mapping, row count and duplicate policy.
Do not start the import yet.
```

The relevant sequence is `upload-create`, `upload-chunk`, `upload-complete` and `import-prepare`, each under `rsl-ie/`. The completed upload returns a file ID; the agent must use that real ID in subsequent requests. Local filesystem paths cannot be substituted for the server’s file ID.

Map `file → file`, `title → title`, `alt_text → alt_text`, `caption → caption` and `description → description`. The admin screen displays the corresponding WordPress storage aliases.

### Prompt 2: validate and run the approved import

```
Validate the prepared three-row Media import.
Match existing items by file_url. Update matches and create missing items.
Use batch size 1 and do not rewrite source URLs.
If validation passes, start the import with a unique request ID.
Poll job-get until the job is completed or failed, then read job-get-result.
Report success, failed and skipped counts. Do not infer success from queued.
```

### Prompt 3: verify the result in WordPress

```
Open the destination Media Library in the browser.
Find the three sample images and compare their attachment IDs with the baseline.
Open the attachment editors and verify title, alt text, caption and description.
Confirm the destination images render and their URLs belong to this site.
For the repeat, confirm all captions start with Updated through MCP:
and no duplicate sample attachments were added.
Report any mismatch before continuing.
```

![Attachment editor after MCP import shows Updated through MCP in the image caption](https://wpimportexport.com/wp-content/uploads/2026/10/media-v2-06-agent-caption.webp)

_The agent changed the caption on the existing attachment. Browser inspection confirms the persisted result._

The test covered an admin-created initial import and an agent-driven metadata update on the same three images. It did not benchmark thousands of remote files, replace existing file bytes or test every WordPress-supported media format. Preview and validation cannot guarantee that a remote server will still return the same file when a later download runs.

## Image metadata and SEO: what this import changes

Importing useful alt text and captions makes the assets easier to reuse, but a Media Library entry alone does not create an optimized landing page. Place the image in relevant page content and check the actual output. Existing blocks or builders may already contain their own saved alt text; updating attachment metadata is not proof that every existing page changed.

Use concise descriptions appropriate to the image’s purpose. Avoid repeating a target keyword in every field. Google’s [image SEO guidance](https://developers.google.com/search/docs/appearance/google-images) emphasizes discoverable image elements, useful surrounding content and descriptive alt text. A bulk import is a way to organize that information, not a guarantee of image-search rankings.

## Troubleshooting image URL imports

| Problem | What to inspect |
| --- | --- |
| The URL downloads a web page | Use the original image address, not the page where it is displayed or a file-sharing preview. |
| HTTP 403, 404 or timeout | Check the source URL, expiry, authentication, hotlink protection and connectivity from the destination server. |
| Rows or fields appear merged | Fix the CSV delimiter, header setting or quoting before importing. |
| Images exist but metadata is wrong | Inspect the mapping. Caption, Description and Alt Text are separate fields. |
| The run creates unexpected duplicates | Review matching fields, incoming URLs and the Create policy. Test a small repeat before the full import. |
| New caption appears in Media but not on a page | Inspect the page’s saved block or builder content and cached output; it may store its own caption. |
| Large images stall processing | Start with batch size one and inspect PHP memory, execution limits, image dimensions and available storage. |
| MCP job stays pending | Check the site’s cron runner and job logs. Reading job status does not itself execute queued work. |

Review partial results before retrying an interrupted import. Some records may already exist even when the client lost its connection. Reusing the same request ID is appropriate when retrying the same uncertain agent request; a deliberately new import should use a new request ID.

## Earlier video walkthrough

The earlier video demonstrates a larger Media Library transfer using the previous interface. Use the updated steps and screenshots above for the 2.0 workflow and AI-agent example. The video remains supplementary; its original import count is not the result of this three-image test.

[Video: Earlier interface: import WordPress Media Library files from another website](https://www.youtube.com/watch?v=OOuyeTdtLcs)

## Frequently asked questions

### Can I import images from URLs into WordPress with a CSV?

Yes. Select Media, upload a CSV with direct image URLs, map the file and metadata columns, configure matching and run the import. Verify the downloaded files and attachments afterward.

### Does the CSV contain the actual image files?

A CSV containing URLs stores references to the files, not their image bytes. The destination must be able to download the source files while the import runs.

### Can I import alt text and captions at the same time?

Yes. Map title, alt text, caption and description alongside the file URL.

### Will importing media set featured images or product galleries?

Not by itself. This workflow creates or updates Media Library attachments. Assigning them to posts, products or variations is a separate relationship step.

### Can I repeat an import without adding duplicates?

Use Update/Create with a consistent matching policy to update existing attachments. Compare their IDs before and after importing.

### Can an AI agent run the Media import?

Yes. With MCP configured, an agent can upload, prepare, validate and start a Media import, then inspect the result.

### What batch size should I start with?

Start with one image per batch and test representative files. Downloads and image resizing consume resources; increasing the batch size is not automatically faster or more reliable.

### Does changing attachment alt text update every existing page?

Do not assume so. Existing blocks and page builders may store their own image markup. Check the rendered page and its saved content after changing Media Library metadata.

Continue with the [import and export tutorials](https://wpimportexport.com/import-export-video-tutorials-for-wordpress/#written-guides) for the next part of your migration.
