Do you want to make your WordPress website’s PDF files searchable? Although WordPress allows you to upload PDF files to your media library, the contents of such files are not included in search results.
We’ll teach you how to add PDF indexing and searching to WordPress in this post.
What Are the Benefits of Including PDFs in Your WordPress Search Results?
PDFs are a wonderful method to provide e-books, user manuals, catalogs, and more to your visitors.
More information on how to upload PDF files to your WordPress site and how to add a PDF viewer to WordPress can be found in our guidelines.
WordPress site search, on the other hand, is rather restricted and only searches the contents of the WordPress database.
If your visitors use your website’s search box, just the title and description of your PDFs and other documents will appear in the search results, not their contents.
As a result, essential information may be lost to your visitors.
With that being said, let’s take a look at how to add PDF indexing and searching in WordPress.
How to Add PDF Indexing and Searching in WordPress
The first step is to download and install the SearchWP plugin. See our step-by-step guide on installing a WordPress plugin for more information.
SearchWP is one of the top premium WordPress search plugins. It’s simple to use and allows you to search PDFs and other files in your WordPress media library.
After activation, go to Settings » SearchWP and choose the ‘License’ menu tab from the drop-down menu.

In the ‘License’ box, you must input your license key. This information is accessible through your SearchWP account. Make sure to click the ‘Activate’ button after you’re finished.
The next step is to add the contents of your PDF documents to the search results in WordPress. To do so, go to the SearchWP ‘Engines’ menu tab and choose it. This will take you to a screen where you can choose what appears in your WordPress search results.

You’ll see that posts, pages, and media assets are all included in the search results by default.
If the ‘Media’ section isn’t there, you may add it by selecting the ‘Sources & Settings’ button and then the ‘Media’ checkbox.

Remember to click the ‘Done’ button to save your changes.
By clicking on the ‘Posts,’ ‘Pages,’ ‘Media,’ or other applicable drop downs, you may change your search engine settings.
You must adjust the Media settings by clicking the ‘Add/Remove Attributes’ button in that area to ensure that PDFs are included in the search results.

Make sure the box labeled “Document Content” is selected.
This implies that the contents of your WordPress media library’s PDFs, Microsoft Office files, text files, and other documents will be indexed and included in search results.

The ‘PDF Metadata’ box should also be checked. This indexes PDF info that isn’t included in the file’s text. The document title, author, subject, keywords, and more may be included, depending on the PDF file.
When both of these boxes are ticked, make sure you click the “Done” button.
The next step is to determine how much weight to give PDF content and metadata in the search results. To put it another way, how prominently do you want PDFs to show in search results on your site?
The Document Contents and PDF Metadata sliders are both set to the far left by default, so they won’t have any influence. You may move them up in the search results if you want them to appear higher in the results.

Finally, in the top right of the screen, click the ‘Save Engines’ button to save your updated search settings.
If the notice ‘The index needs to be rebuilt’ appears, click the ‘Rebuild Index’ button to have the PDF content and metadata included in the search index.

Congratulations! PDF files may now be indexed and searched on your WordPress website.
After that, you might want to activate some additional options to help your users find what they’re looking for.
To do so, go to Settings » SearchWP and select the ‘Advanced’ tab from the drop-down menu.

You may now select any of the following options to activate:
- Partial matches will also provide results that don’t quite match the phrase you’re looking for.
- The automatic ‘Did you mean?’ adjustments will propose a slightly different search phrase that matches some of your website’s content.
- Support for ‘quoted/searches’ allows your users to search for certain phases using quotes.
- Highlighting phrases in search results will make it simpler for them to find what they’re looking for.
When a visitor to your website searches for a word or phrase, all relevant PDF files will appear in the search results.
We hope this tutorial helped you learn how to add PDF indexing and searching in WordPress.