Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Add PDF Indexing and Searching in WordPress

PDF documents are often packed with valuable information. But on many WordPress sites, that content is completely invisible in search results.

By enabling PDF indexing in WordPress search, you can make your entire content library discoverable. Visitors are more likely to find what they’re looking for, whether it’s inside a product manual, an eBook, or a help doc.

Fortunately, setting this up is easier than you might think!

At WPBeginner, we’ve helped site owners improve their on-site search simply by making their PDFs searchable.

In this step-by-step guide, we’ll show you exactly how to add PDF indexing and searching in WordPress. We’ve tested multiple methods and will walk you through the best solution to improve your site’s search functionality. 🔎

How to Add  PDF Indexing and Searching in WordPress

Why Make WordPress Search PDF Files?

Uploading PDFs to your WordPress site is a great way to share ebooks, user manuals, brochures, and other downloadable content. You can even embed a PDF viewer so visitors can read the document without downloading it.

However, WordPress’s built-in search only indexes the title and description of uploaded files. It doesn’t scan the actual content inside your PDFs.

This means valuable information can be completely overlooked in search results. ⚠️

As a result, visitors may struggle to find what they’re looking for. Even though the information is right there, just buried inside a PDF.

The good news is that you can improve the WordPress search so that it includes PDF and other file contents in its search results.

With that being said, let’s take a look at how to add PDF indexing and searching in WordPress. You can use the quick links below to navigate through this tutorial:

Step 1: Install and Set Up SearchWP

The best way to add PDF indexing and searching in WordPress is by using SearchWP. It is the best WordPress search plugin that allows you to include all kinds of content in your search results, including custom post types, WooCommerce products, comments, PDFs, and more.

You can see our complete SearchWP review for more details.

The first thing you need to do is install SearchWP. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, go to SearchWP » Settings and then click on the ‘General’ tab.

Improving the WordPress search using SearchWP

Here, you need to enter your license in the ‘License Key’ box. You can find this information under your account on the SearchWP site.

Once you’re done, make sure to click the ‘Verify Key’ button.

Step 2: Customize Your WordPress PDF Search Algorithm

With that done, you’re ready to add the contents of your PDF documents to the WordPress search engine results.

To start, you can go to SearchWP » Algorithm.

The SearchWP search optimization WordPress plugin

This brings you to a screen where you can specify what SearchWP should include in its search results, such as pages and posts.

By default, SearchWP should search your site’s media files. However, if you can’t see a ‘Media’ section, then you will need to add it by clicking the ‘Sources & Settings’ button.

Making more content searchable using SearchWP

This shows all the different content that you can include in the WordPress search results. For example, you can make blog comments searchable in WordPress.

In the popup, select ‘Media’ and then click on ‘Done.’

How to search media on your WordPress website

To make the search engine index PDF files in WordPress, scroll to the ‘Media’ section.

Here, click on the ‘Add/Remove Attributes’ button.

Adding and removing attributes to the WordPress search algorithm

In the popup that appears, check the ‘Document Content’ box if it isn’t already selected.

These settings tell SeachWP to index the contents of your PDFs, Microsoft Office files, text files, and other documents in the WordPress media library. It will then include this content in any relevant search results.

You should also check the ‘PDF Metadata’ box. SearchWP will then index PDF metadata that isn’t part of the file’s contents. These include its title, author, subject, and keywords.

Adding PDF contents and metadata to the WordPress search

Depending on the PDF, this may help visitors find what they’re looking for.

For example, if you run an online marketplace, then metadata can help shoppers find the PDF user manual for a specific WooCommerce product. With that in mind, it’s often smart to include this information in the search results.

When you’re happy with the changes you’ve made, click on the ‘Done’ button.

‘Document Content’ and ‘PDF metadata’ will now appear in the ‘Media’ section, along with any other attributes that SearchWP searches by default, such as title and slug.

You’ll notice that each item has an ‘Applicable Attribute Relevance’ scale. This is the weight that SearchWP will give to each attribute.

Fine-tuning the WordPress search algorithm on your WordPress blog or website

Content that matches an attribute with high relevancy will appear higher in the search results. On the other hand, content that matches an attribute that has less relevance will appear lower in the user’s search results.

By default, the sliders for Document Contents and PDF Metadata are all the way to the left, so they don’t carry much weight. If you want the document content and PDF metadata to have a bigger impact on the search results, then simply move the sliders.

Changing the attribute relevancy sliders in the search algorithm

Every WordPress website is unique, so you may want to try different relevancy settings to see what gives you the most accurate and helpful search results.

For example, let’s say you’ve uploaded the menu as a PDF on your restaurant website. Then it’s important content, and you’ll typically want to show it high in the search results.

Once you’re happy with how the search feature is set up, scroll to the top of the screen and click the ‘Save’ button.

Saving your custom WordPress search algorithm

SearchWP will now rebuild the index automatically.

Depending on the speed of your Internet connection and your WordPress hosting provider, this may take a few minutes.

As soon as you see ‘Index Status 100%,’ you’ll know that SearchWP has added all the PDF contents and metadata to its search index.

Rebuilding your WordPress search index

Congratulations!

Your WordPress website or online store will now show PDF content and metadata in its search results.

Step 3: Create and Embed a Custom Search Form (Optional)

Technically, you only need to complete steps 1 and 2 to make PDF files searchable in WordPress. But if you want to improve your WordPress search experience even better, then we suggest creating a custom search form, too.

Doing this lets you build a search bar that’s better suited to your users’ search behavior. Perhaps you have a lot of content on your site, and your visitors prefer using a search bar with menus to narrow down their findings.

If you want to build a custom search form, you can read our guide on how to create a custom WordPress search form.

An example of a custom search form

You may also want to check out our article on how to create an advanced search form for custom post types if you deal with a lot of non-blogging content.

Additionally, you may want to edit your search results page to make it even more user-friendly. For this, you can read our guide on how to customize the search results page in WordPress.

Now that you’ve added PDF indexing and searching in WordPress, you may want to enable some of SearchWP’s more advanced features. This will make it even easier for visitors to find what they’re looking for.

To do that, go to SearchWP » Settings and scroll to the ‘General Settings’ section.

Improving the WordPress search using SearchWP's advanced settings

Here, you can activate any of the following settings:

  • Partial matches. With this setting enabled, SearchWP will display results that aren’t an exact match for the visitor’s search query. You can learn more about this in our article on how to add fuzzy search in WordPress.
  • Closest match. After enabling partial matches, you can also show the closest matches when a search has no results.
  • “Quoted” searches. This allows visitors to search for exact phrases by using quotes.
  • Highlight terms. Automatically highlights the search terms to help visitors find what they’re looking for.

Another thing you can do is enable live AJAX search in your search algorithm. This means your search bar will show results as the visitor is typing into it, making it quicker for them to find answers.

FAQs About Making PDFs Searchable in WordPress

Have more questions? Here are some frequently asked questions about making PDFs searchable in WordPress.

What types of files can SearchWP index besides PDFs?

SearchWP can index a variety of files, including Microsoft Office documents, text files, media files, and custom post types. This makes it a versatile tool for improving search functionality across different content types on your site.

Can SearchWP index password-protected PDFs?

No, SearchWP cannot index the contents of password-protected PDFs. It’s designed to index only accessible content, so make sure your PDFs aren’t password-protected if you want them included in search results.

How does indexing PDFs affect site performance?

Indexing PDFs might increase the resource usage slightly, especially on WordPress sites with many large documents.

However, most users report minimal impact, and the improved search experience often outweighs any performance changes. For best results, ensure your hosting plan can handle the extra load. Or, see our ultimate guide on improving WordPress speed and performance.

We hope this tutorial helped you learn how to add PDF indexing and searching in WordPress. You may also want to learn how to see search analytics in WordPress and our expert tips for how to fix WordPress search not working.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

4 CommentsLeave a Reply

  1. searchWP suggests that it only scans the PDF titles and metadata, and to do more, you need their Xpdf integration.

  2. DYNAMITE post! The reasons you give are several well-chosen ones out of literally dozens. For many non-profits and others, “newsletters” have been the very heart of their communications process. “Looking for an article on X” is a close relative of what’s made Google one of the very largest companies on earth. But PDF’s – so very common – are (as you point out) all but “foreign language” for reasons I cannot really grasp. Google ostensibly indexes them, but there is some complexity (way beyond “Were they scanned?”) that renders it hit-and-miss in this connection.

    How I hope that SearchWP has some sort of “trial” feature, because if Google hasn’t nailed it, I’m more than a little skeptical that someone else has!

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.