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 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
- Make a file with a File URL column and, optionally, Title, Caption, Description and the ID of the page to attach the document to.
- Go to Import Export by RockStarLab → Import, choose Media and upload the file.
- Click Auto Map, then drag the page ID column to Attached To (Post ID).
- 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):

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:

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 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) 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
- How to Export the WordPress Media Library to CSV or Excel
- Find Large Images in the WordPress Media Library
- Sync Featured Images and Media Between WordPress Sites
Get the free plugin on WordPress.org.

Comments 0
Have a question or a tip to share? Leave it below.