SearchWP Blog

WordPress Tutorials, Tips, and Resources to Help Grow Your Business

How to make WordPress search media files thumbnail

If you’ve ever uploaded important PDFs, product images, or downloadable guides to your WordPress site, you know how frustrating it is when visitors can’t find them.

We’ve watched people use our search bar looking for a specific resource guide or product photo, only to get zero results. The file exists on our site, but WordPress acts like it doesn’t.

This happens because the default WordPress search completely ignores your media library. It doesn’t look at image filenames, PDF content, or any document you’ve uploaded.

In this article, we’ll show you how to make WordPress search media files.

Why Do You Need To Make WordPress Search Media Files?

Enhancing your WordPress site to search all types of media files, such as images, videos, audio clips, and documents, transforms how visitors interact with your content.

Being able to search media files can directly impact sales. Imagine you sell electronic gadgets online.

A customer comes to your site looking for a ‘digital camera.’ If they can’t search through images or manuals, they might miss the perfect match, especially if it’s only detailed in file attributes and not well-described on the page.

By searching across media types, you can make sure that your customers can find the right product on their first try with minimal effort.

Therefore, let’s see how to make the most common media file types searchable in WordPress:

How To Make WordPress Search Media Files

The simplest way to make WordPress search media files is to use SearchWP.

It is the most powerful search plugin for WordPress and will significantly enhance your website’s search results.

SearchWP - Best WordPress Search Plugin

SearchWP makes all your media files fully searchable. It indexes their titles and metadata, including alt text, captions, and descriptions.

The plugin can also search through document content and EXIF data in your images, significantly enhancing your site’s search functionality.

Using SearchWP, you can make nearly everything on your site searchable. It also offers multiple search engines, customizable search rules, access to search statistics, and a ton of other features.

Over 50,000 WordPress site owners worldwide use this tool to outperform competitors and improve visitor search experiences.

Furthermore, here are some critical features of SearchWP that make it invaluable for online businesses:

  • WooCommerce Integration: SearchWP seamlessly integrates with WooCommerce, improving search capabilities for product media files and beyond.
  • PDF and Office Documents Indexing: You can make the content of PDFs, Office documents, and rich text documents searchable by parsing their content.
  • Multiple Search Engines: You can create specialized search engines for different types of content, including a dedicated engine for media files.
  • Search Behavior Analysis: Tracks user search trends on your site, providing valuable insights into customer preferences and behaviors.
  • Prioritize Search Results: You can easily adjust the order of search results to highlight specific pages or items, enhancing visibility with just a few clicks.

Now, let’s get started with setting up SearchWP so that you can make WordPress search media files.

Step 1: Setting Up SearchWP On Your Site

First, you will need to choose a SearchWP package that fits your needs.

After purchasing, head to the ‘Downloads’ section on your Account page.

Download SearchWP plugin from account area

Next, press the Download SearchWP button and save the plugin’s ZIP file to your computer.

We also recommend copying your license key from the bottom left corner of this page. You’ll need it in just a moment to activate the plugin.

Now, you’ll need to upload the SearchWP ZIP file to your WordPress site and install the plugin. If you need help with this step, check out this guide on how to install a WordPress plugin.

After you activate SearchWP, you’ll see the welcome screen with the setup wizard. Go ahead and click the ‘Start Onboarding Wizard’ button and follow the onscreen instructions to complete the setup.

Onboarding wizard SearchWP

Step 2: Set Up Search Engine to Make Media Files Searchable

SearchWP automatically replaces the default WordPress search on your site once installed. You’ll need to configure the search engine to enable searching for media files.

You can either modify the existing default Engine or create a new Supplementary Engine dedicated to searching media files.

For the purpose of this tutorial, let’s set up a new Engine. Simply visit SearchWP » Algorithm and click the ‘Add New’ button in the Engines tab to get started.

How to make WordPress search media files: Configure Engine Step 1

In the popup window that appears next, select the Media option and give your engine a descriptive name.

As a result, this engine will only show media files in the search results. If you want to add more content types, please check other sources you’d like to have.

How to make WordPress search media files: Configure Engine Step 2

Once you’ve done that, click ‘Done’ to save your settings.

Now, you can click the Add/Remove Attributes button located on the Media tab so that you can identify what to index.

How to make WordPress search media files: Configure Engine Step 3

Next, you will see a popup window where you can select different attribute sources.

For example, you can make document content, PDF metadata, title, description, and other attributes searchable.

There is also an option to include custom fields and taxonomies in the search process.

How to make WordPress search media files: Configure Engine Step 4

When you’re finished, go ahead and click the Done button.

You can also adjust the attribute relevance for search results using the slider. The greater the relevance, the higher the content will rank on the search results page.

Adjust media weights

Next, you will need to scroll to the top of the page.

Finally, click Save to store the new settings.

How to make WordPress search media files: Configure Engine Step 6

Now, you might need to rebuild the index in order for the changes to take effect.

To do this, click Rebuild Index to initiate the process manually.

How to make WordPress search media files: Configure Engine Step 7

Based on your website’s current configuration, you might see a popup during this process. When SearchWP indexes an image or document file, it gathers all indexable data and saves it in its database.

If you prefer to replace the existing index data with new data, check the ‘Remove stored Document Content, PDF Metadata, and image EXIF when rebuilding index’ option and then click Continue Index Rebuild.

How to make WordPress search media files: Configure Engine Step 8

Congratulations! You have successfully made WordPress search media files on your website!

Step 3: Create a Search Form to Search Media Files

Now, you can use this Engine with any search form you create using SearchWP. To do this, navigate to SearchWP > Search Forms, then click “Add New.”

How to make WordPress search media files: Create Search Form Step 1

Next, you can start by entering a name of the search form

SearchWP also offers multiple Layout themes to choose from. Simply select one and customize it according to your needs.

How to make WordPress search media files: Create Search Form Step 2

After that, you should be able to customize the search form as necessary.

Most importantly, you’ll need to assign an Engine to this form. To do this, locate the Engine section and select the newly created ‘Media Engine’ from the dropdown menu.

How to make WordPress search media files: Create Search Form Step 3

Once you’ve made other modifications according to your needs, you can click Save to store your settings.

Now, visitors will see media files such as PDFs, documents, videos, audio, and images in the search results made using this search form.

How to make WordPress search media files: Create Search Form Step 4

SearchWP provides multiple ways to embed this search form into your website.

Go ahead and click the Embed button next to Save, and you’ll see different options.

How to make WordPress search media files: Publish Search Form

You can enter the search form using a Gutenberg block, shortcode, or PHP code.

Pick the embed method that suits you best. For more details, please see this guide on how to create an advanced search form in WordPress.

Next, you can simply visit your website and test the search form.

Search for image on your site

For example, on our demo site, we have image saved as ‘Coffee.’

Searching for the media file name showed that it appears in the search results.

View image search result

When we click on image, it opened the correct file.

This shows that the media file search is working properly.

FAQs About Making Media Files Searchable

Here are some common questions we get about making media files searchable in WordPress.

1. Will SearchWP search inside PDF files?

Yes, SearchWP can read and index the actual text content inside your PDF files. This means visitors can find PDFs based on the words written inside them, not just the filename. Just make sure that your files are uploaded to the Media Library. 

2. Can I make only certain file types searchable?

Absolutely. SearchWP lets you choose exactly which media attributes to include in your search. You can make only images searchable, or only PDFs, or any combination of file types you want.

3. Will this slow down my website?

No, SearchWP creates its own search index in the background. This means searching happens quickly without putting extra load on your server or slowing down your site for visitors.

4. Do I need coding skills to set this up?

Not at all. We’ve walked you through the entire process in this tutorial, and it only requires clicking a few buttons in your WordPress dashboard. No code editing needed.

We hope this tutorial helepd you learn how to make WordPress search media files. You may also want to see our guide on how to customize the WordPress search results page and how to highlight search terms in WordPress search results.

Get SearchWP now to equip your website with advanced search capabilities.

author avatar
Aazim Akhtar

Create a Better WordPress Search Experience Today

Never lose visitors to unhelpful search results again. SearchWP makes creating your own smart WordPress search fast and easy.

Get SearchWP Now
Multiple Search Engines Icon