How to Add PDF Indexing and Searching in WordPress
Do you want to make the PDFs on your WordPress website searchable?
WordPress allows you to upload PDF files to your media library, but doesn’t include their contents in search results.
In this article, we’ll show you how to add PDF indexing and searching in WordPress.
Why Add PDFs to Your WordPress Search Results?
PDFs are a great way to offer your visitors ebooks, user manuals, catalogs, and more. You can learn more in our guides on how to upload PDF files to your WordPress site, and how to add a PDF viewer in WordPress.
However, WordPress site search is quite limited and will only search the contents of the WordPress database.
This means that if your visitors use the search bar on your website, only the title and description of your PDFs and other documents will be included in the search results, not their contents.
As a result, your visitors may be missing out on valuable information.
The good news is that you can use a custom search plugin to improve the default WordPress search experience. If your PDFs are unencrypted, then the right search plugin will index the contents and metadata of your PDFs and add them to your search results.
With that being said, let’s take a look at how to add PDF indexing and searching in WordPress.
Adding PDFs to Your WordPress Search Results
SearchWP is one of the best premium search plugins for WordPress. It’s easy to use and lets you search the contents of PDFs and other files in your WordPress media library.
Upon activation, you will need to visit the Settings » SearchWP page and then click on the ‘License’ menu tab.
Here you need to enter your license key in the ‘License’ box. You can find this information in your account on the SearchWP site. Once you’re done, make sure to click the ‘Activate’ button.
The next step is to add the contents of your PDF documents to the WordPress search results. To do that, you need to click on the SearchWP ‘Engines’ menu tab. This brings you to a screen where you can determine what is included in your WordPress search results.
You’ll notice that by default, posts, pages and media files will be included in the search results.
If the ‘Media’ section is missing, then you will need to add it by clicking the ‘Sources & Settings’ button then clicking the ‘Media’ checkbox.
Don’t forget to click the ‘Done’ button to store the new settings.
You can adjust your search engine settings by clicking on the ‘Posts’, ‘Pages’, ‘Media’, or other available drop downs. To make sure that PDFs are included in the search results, you will need to configure the Media settings by clicking the ‘Add/Remove Attributes’ button in that section.
Make sure that the ‘Document Content’ box is checked.
This means that the contents of your PDFs, Microsoft Office files, text files, and other documents in your WordPress media library will be indexed and included in search results.
You should also check the ‘PDF Metadata’ box. This will index PDF metadata that isn’t part of the file’s contents. Depending on the PDF file, this may include the document title, author, subject, keywords, and more.
Make sure you click the ‘Done’ button when both of these boxes are checked.
Next, you need to decide how much weight to give to PDF content and metadata in the search results. In other words, how high do you want PDFs to appear in your site’s search results?
By default, the sliders for Document Contents and PDF Metadata are all the way to the left, so they will not be given much weight. If you want them to appear higher in the search results, then you can move the slider to the middle or right positions.
Finally, you need to click the ‘Save Engines’ button at the top right of the screen to save your new search settings.
If you’re then shown the message ‘The index needs to be rebuilt’, then you should click the ‘Rebuild Index’ button so that the PDF content and metadata are added to the search index.
Congratulations! Your WordPress website can now index and search PDF files.
Next, you may like to enable some advanced settings that will make it easier for your users to find what they are looking for.
To do that, you should navigate to Settings » SearchWP and click on the ‘Advanced’ tab.
You can now activate any of these options that you would like:
- Partial matches will also display results that don’t quite match the term that is being searched for.
- Automatic ‘Did you mean?’ corrections will suggest a slightly different search term that will match some posts on your website.
- Support ‘quoted/phrase searches’ will allow your users to use quotes when searching for exact phases.
- Highlight terms in results will make it easier to find what they are looking for in the search results.
Now when your website visitors search for a word or phrase, all relevant PDF files will be included in the search results.
We hope this tutorial helped you learn how to add PDF indexing and searching in WordPress. You may also want to learn how to create a WordPress membership site, or check out list of must have plugins to grow your site.