Skip to content
Free

Searchable PDF text

Let WordPress site search — and the library search — find posts by the words inside their PDFs.

1 min read Updated

On this page

WordPress search normally sees only the text you type into a post. A post that embeds a 40-page report is invisible to a visitor searching for a word in that report. Foliora fixes that.

How it works#

  1. Extract. When you open Foliora → Docs & Features, your browser reads the text of each PDF with the bundled PDF.js and saves it on the PDF attachment (up to 80,000 characters per file).
  2. Index. Posts and pages that embed a PDF get a combined search index of their PDFs' text.
  3. Search. Your site's normal search box now matches those posts. The library search uses the same text.

Turn it on or off#

Foliora → Settings → Search and sharing → Site search (on by default).

What is skipped#

  • Scanned PDFs are images with no text layer — they show No text on Docs & Features. Run them through OCR (for example in Acrobat) and upload them again.
  • Password-protected PDFs cannot be read without the password.

After you change a PDF#

Replace the file, open Docs & Features again, and run wp foliora reindex on large sites to rebuild the index of every post that embeds a PDF.

Developers can clean or extend the text with the foliora/extracted_text, foliora/extracted_text_max_chars and foliora/search_index filters. See Hooks.