Guides

How to Add a Searchable Document Library to WordPress

October 15, 2026 · 3 min read

WordPress sites collect documents quickly: forms in the media library, PDFs linked from old posts, a "Resources" page that keeps growing. The usual answer is a document library plugin. Plugins can work well, especially if you need members-only files or upload workflows, but many charge a yearly license for search and filters, add more settings to manage, and need updating along with everything else.

If your documents are public and you just want visitors to find them, there's a lighter option: keep the list in a Google Sheet and show it with a small component in a Custom HTML block. No plugin to install or update.

Self-hosted WordPress or WordPress.com?

This matters, because it decides whether WordPress will run the code.

  • Self-hosted WordPress (WordPress.org), on your own hosting: administrators can add scripts in a Custom HTML block. If you're an Editor or Author on a multisite network, WordPress may strip scripts when you save; ask an administrator to add the block.
  • WordPress.com: scripts only run on plans that support plugins, once hosting features are activated. On other WordPress.com plans, script code is removed when you publish. Check your plan under Upgrades → Plans.

Step 1: Gather your documents in a Google Sheet

You probably already have the files in your Media Library. Open each one and use Copy URL to clipboard to get its link. Then build a sheet with one row per document:

TitleURLDescriptionCategoryDate
Member Handbookhttps://yoursite.org/wp-content/uploads/2026/01/handbook.pdfEverything new members need to know.Membership2026-01-10
Board Minutes, Marchhttps://yoursite.org/wp-content/uploads/2026/03/minutes-march.pdfApproved minutes from the March meeting.Governance2026-03-18

Good titles and a handful of consistent categories make search work much better. See How to Add a Searchable Document Library to Your Website for tips.

Step 2: Publish the sheet as CSV

In Google Sheets, choose File → Share → Publish to web, select the tab, change "Web page" to Comma-separated values (.csv), and click Publish. Copy the link (it contains /pub? and ends in output=csv).

Step 3: Add a Custom HTML block

  1. Edit the page where the library should appear.
  2. Click +, search for Custom HTML, and add the block.
  3. Paste your library component's code and put in your published sheet link.
  4. Click Preview in the block toolbar to check it, then Update or Publish.

On classic-editor sites, switch the editor to the Text tab before pasting, so the code isn't converted to visible text.

If the library doesn't appear

  • Check the live page while logged out. Some caching or optimization plugins only apply changes after the cache clears.
  • Security plugins sometimes strip scripts from page content. If yours does, load the script through a "header and footer scripts" plugin and keep only the library's HTML line in the block.
  • Script optimizers that combine or delay JavaScript can stop small embedded scripts. Exclude the page or the script from optimization.
  • Open the browser console (F12 → Console). A well-built component prints a message that explains what's wrong, such as a sheet link that isn't published as CSV.

Keeping it current

From then on, upload new PDFs to the Media Library as usual, copy the link, and add a row to the sheet. The library updates within a few minutes. Staff who don't have WordPress access can maintain the list too: share the sheet with them.

The ready-made option for WordPress

Resource Finder works exactly this way: one snippet in a Custom HTML block, no plugin. Visitors get search as they type, category buttons, a file-type filter that recognizes PDF, Word and spreadsheet links on its own, sorting by date or title, and shareable filtered links. It uses your theme's fonts, works on phones, and supports keyboards and screen readers.

The download includes WordPress instructions, a spreadsheet template and a demo. It's a one-time purchase from $49 for one website, with an agency license for designers who build WordPress sites for clients.

Try the live demo, or ask us a question about your WordPress setup.