Back to blog
4 min read 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 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
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
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 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

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.

Get the free plugin on WordPress.org.

Dmitriy
About author

Dmitriy

WordPress Developer with 15+ years of commercial experience. Elite Author on ThemeForest and creator of custom WordPress plugins. Passionate about clean code, performance optimization, and building useful tools for the WordPress community.

JOIN THE CONVERSATION

Comments 0

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

Leave a comment

Your email address will not be published. Required fields are marked *

We store your name, email and comment to show and moderate it; your email is never published. Spam protection is provided by Cloudflare Turnstile and profile pictures by Gravatar. See our Privacy Policy.


Try the plugin with no risks!

New users get 1 month with access to all premium features. Experience the most powerful WordPress data engine today.

Download Now
Get PRO for FREE