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 Make Custom Fields Searchable in WordPress

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Do you want to make custom fields searchable in WordPress?

By default, WordPress doesn’t include custom fields in its search results. If you use custom fields on your site, then including them in your search results can help visitors find what they’re looking for.

In this article, we will show you how to make custom fields searchable in WordPress.

How to make custom fields searchable in WordPress

What Are Custom Fields & Why Make Them Searchable?

WordPress automatically adds metadata such as the title, author, date, and time to your content. However, you can store additional information about a page or post using custom meta boxes.

A lot of must-have WordPress plugins and themes also use custom fields to store important information. For example, All in One SEO uses custom fields to store SEO data.

AIOSEO Product Title Optimization

If you are using WooCommerce, then some of your custom product attributes may also be classed as custom fields.

The problem is that the default WordPress search ignores these custom fields and only looks for matches in the title and content. By making your custom fields searchable, you can help visitors find pages, posts, products, and other important content.

That said, let’s look at how you can make custom fields searchable in WordPress.

Making Custom Field Searchable in WordPresss

The easiest way to make custom fields searchable is by using the SearchWP plugin. It’s the best WordPress search plugin and allows you to show more helpful and relevant search results by creating a custom search algorithm.

SearchWP

With SearchWP, you can search content that WordPress ignores by default, including custom post types, PDF files, WooCommerce products, categories, and custom fields. This allows you to improve the WordPress search for your users.

The first thing you need to do is install and activate the plugin. 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.

Activating the SearchWP search plugin

Here, you need to enter your license in the ‘License Key’ box. You can find this information in your account on the SearchWP site. Once you are done, make sure to click the ‘Verify Key’ button.

Create a Custom Search Algorithm

After activating the plugin, you can fine-tune how SearchWP indexes, searches, and displays your content. You can think of this as creating a custom Google search algorithm that’s just for your WordPress blog or website.

To start, head over to SearchWP » Algorithm.

Creating a custom search algorithm in WordPress

Here, you’ll see a section for the different content types that SearchWP searches by default, such as pages, posts, and media files.

To get started, simply scroll to the content where you want to start searching custom fields. In our images, we’re searching the custom fields attached to Posts, but the steps will be exactly the same for all content types.

In your chosen section, find the ‘Add/Remove Attributes’ button and give it a click.

How to make custom fields searchable in WordPress

In the popup that appears, click to open the ‘Custom Fields’ dropdown menu.

To search all the custom fields, simply select ‘Any Meta Key.’

How to make all your custom fields and metadata searchable in WordPress

If you want to search specific custom fields only, then start typing their names and then select the right option when it appears. Once you’ve chosen the custom fields that SearchWP should include, click on ‘Done.’

After that, you’ll see a new ‘Custom Fields’ option in this section.

Changing the attribute relevancy scale for custom fields and metadata in WordPress

Each custom field has its own Application Attribute Relevance slider, which allows you to control how SearchWP ranks the content on your online marketplace, blog, or website.

For example, if you move a slider to the right, then the custom field will carry more weight. This means it’ll have a bigger impact on where the content appears in the search results.

How to improve the WordPress search by including custom fields

When you are happy with how the search algorithm is set up, scroll to the top of the screen and click the ‘Save’ button.

SearchWP will now rebuild the index automatically. 

How to save the SearchWP search engine

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 indexed your PDF metadata, custom fields metadata, images, files, and any other types of metadata that you’ve chosen to include in your website’s search.

Rebuilding your website's search index using SearchWP

WordPress will now start showing relevant custom fields on its search results page.

How to Improve WordPress Search with SearchWP

This is a great start, but there are more ways to improve the built-in WordPress search with SearchWP. 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.

The advanced SearchWP search 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.
  • 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 using quotes.
  • Highlight terms. Automatically highlights the search terms to help visitors find what they’re looking for.

To help you fine-tune your website’s search, it’s a good idea to monitor how visitors are using the search feature. This allows you to see what’s working and what’s not working on your WordPress blog, so you can constantly improve your site’s search and help visitors find what they are looking for.

To see the search history and most popular search terms, simply select ‘Statistics’ in the left-hand menu.

WordPress search statistics and data, in the SearchWP dashboard

SearchWP will show detailed information from the past 30 days, the last year, or the entire history of your site. This data can even help you generate blog post ideas by showing the topics that visitors are most interested in.

You can see our complete SearchWP review for more details.

We hope this article helped you learn how to make custom fields searchable in WordPress. You may also want to look at our guide on custom fields 101 and our expert picks for the best WordPress SEO plugins and tools.

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.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

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

5 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

Leave a Reply to Usama Sajjad Cancel 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.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.