---
title: "Import PDFs and Documents into WordPress from CSV (with Titles and Descriptions)"
url: "https://wpimportexport.com/bulk-import-pdf-documents-wordpress-media-library-csv/"
description: "Import PDFs and other documents into the WordPress Media Library from a CSV of URLs, with titles, captions, descriptions and the page each file belongs to."
type: post
published: 2026-11-12T09:00:00+00:00
modified: 2026-11-14T10:43:57+00:00
categories: ["Import Guides", "Tutorials"]
tags: ["CSV import", "Import Export by RockStarLab"]
docs_topics: ["Import guides"]
---

# Import PDFs and Documents into WordPress from CSV (with Titles and Descriptions)

Price lists, menus, brochures, spec sheets, allergen information: many sites keep a shelf of PDFs that people download. When you move to a new site or a supplier sends a batch of documents, uploading them one by one and typing each title and description takes a long time. [Import Export by RockStarLab](https://wordpress.org/plugins/import-export-by-rockstarlab/) imports PDFs and other documents into the Media Library from a CSV or Excel file, with their titles, captions and descriptions, and can attach each one to a page. The example has four PDFs for a coffee roastery.

**Free:** everything in this guide works in the free plugin.

## Short Answer

1. Make a file with a **File URL** column and, optionally, Title, Caption, Description and the ID of the page to attach the document to.
2. Go to **Import Export by RockStarLab → Import**, choose **Media** and upload the file.
3. Click **Auto Map**, then drag the page ID column to **Attached To (Post ID)**.
4. Run the import and check the documents in **Media → Library**.

## The file

```
File URL,Title,Caption,Description,Attached To
https://old.example-roastery.com/wp-content/uploads/downloads/wholesale-price-list-2026.pdf,Wholesale price list 2026,Prices per kg for cafés and shops,"Updated every January. Prices exclude VAT.",2033
https://old.example-roastery.com/wp-content/uploads/downloads/brewing-guide-v60.pdf,V60 brewing guide,One-page recipe card,"Our house recipe for pour-over at home.",
https://old.example-roastery.com/wp-content/uploads/downloads/cafe-menu-spring.pdf,Café menu – spring,Drinks and prices,"Valid March to May.",
https://old.example-roastery.com/wp-content/uploads/downloads/allergen-information.pdf,Allergen information,,"Milks and pastry allergens for our café.",
```

- **File URL** must be a public, direct link to the PDF. A link to a page that shows the PDF, or to a cloud drive’s preview, won’t work.
- **Attached To** is the ID of a post or page on the new site. You see it in the address bar when you edit the page (`post=2033`). Leave it empty for documents that don’t belong to a page.
- Commas inside a description need quotes around it.

## Map the columns

Auto Map matched File URL, Title, Caption and Description. We dragged **Attached To** onto **Attached To (Post ID)**:

![Mapped Fields for a media import: Title to post_title, File URL to file_url, Caption to post_excerpt, Description to post_content, Attached To to post_parent](https://wpimportexport.com/wp-content/uploads/2026/11/01-mapped-fields-2.webp)

_Attached To takes the ID of the page the document belongs to._

Caption and description are stored as the attachment’s excerpt and content, as WordPress does for every media file. On the next step, **Check for Existing Items by Field** set to Title with **Update** lets you import a corrected file later without creating copies.

## The result

The four PDFs were imported in 3 seconds. In the Media Library, filtered to documents:

![Media Library filtered to documents: Allergen information, Wholesale price list 2026 uploaded to Wholesale, V60 brewing guide and Café menu – spring](https://wpimportexport.com/wp-content/uploads/2026/11/02-media-library-pdfs.webp)

_Four PDFs with their titles; the price list is attached to the Wholesale page._

The price list is attached to the Wholesale page, and the others are unattached. WordPress made a preview image of the first page for each PDF where the server supports it. The files kept their folder from the old site (`uploads/downloads/`), so each document keeps the same path after the domain, and old links are easy to update with **Replace links**.

To link a document from a page, use the File block or a normal link to the file’s URL, which you can copy from the Media Library with **Copy URL**.

## Not only PDFs

The same import works for the other file types WordPress accepts in a normal upload, such as Word and Excel documents. If WordPress doesn’t accept a type, that row fails and the result says so.

## Before you import

Documents take disk space, and a wrong Attached To value puts files on the wrong page. [Back up the site](https://wpimportexport.com/how-to-create-a-wordpress-website-backup-and-restore-it/) and import a few rows first.

## With an AI agent

An AI agent connected through the WordPress MCP Adapter (see [connecting Claude Code to WordPress](https://wpimportexport.com/connect-claude-code-to-wordpress-mcp/)) can check what’s in the library after the import:

```
List all PDFs in the Media Library with their URLs and the page they're attached to.
```

In our run, the agent called `rsl-ie/export-count` for media with MIME type `application/pdf` (count: 4), then `rsl-ie/export-start` with title, file URL, file size and attached post title. The CSV it got from `rsl-ie/file-get` listed the four documents, with “Wholesale” next to the price list.

## FAQ

### Can I import PDFs from Google Drive or Dropbox links?

Only if the link downloads the file directly. A share link that opens a preview page doesn’t work.

### Can I attach a document to a page by its title instead of the ID?

Use the page ID in Attached To. An export of Pages with the ID and Title columns gives you the list.

### Will the import create duplicate documents?

Not when Check for Existing Items is set to Title with Update; a second run updates the documents.

### Can I import Word or Excel files?

Yes, if WordPress accepts the file type in the Media Library.

### Where are the files stored?

In the uploads folder, under the same path they had on the old site.

## Related Guides

- [Bulk Import Images from URLs into the WordPress Media Library](https://wpimportexport.com/bulk-import-images-from-urls-wordpress-media-library/)
- [How to Export the WordPress Media Library to CSV or Excel](https://wpimportexport.com/export-wordpress-media-library-to-csv-excel/)
- [Find Large Images in the WordPress Media Library](https://wpimportexport.com/find-large-images-wordpress-media-library-file-sizes/)
- [Sync Featured Images and Media Between WordPress Sites](https://wpimportexport.com/sync-featured-images-media-between-wordpress-sites/)

Get the free plugin on [WordPress.org](https://wordpress.org/plugins/import-export-by-rockstarlab/).
