SearchWP

News

How to Add Custom Fields Search in WordPress

Are you trying to add custom fields search to your WordPress site?

Custom fields are a useful WordPress feature for adding extra information to your site content. If your site users can search your custom fields, they’ll get to see more relevant results. This can help you boost your sales and customer satisfaction.

In this article, we’ll show you how to add custom fields search in WordPress the easy way. You’ll learn how to do this without writing a single line of code.

Let’s get to it!

What Are WordPress Custom Fields?

A custom field is a content attribute that WordPress uses to store information about a particular post, page, or any content type.

Each time you add content to your site, WordPress automatically saves it in two different areas.

The first area is the body of the content. For example, the body of a post is the main part that the site user reads.

The second area is the extra information related to the main content. Typically, this is where you save information like the title, description, tags, and categories. This area is also called the metadata.

WordPress offers specific metadata fields by default.

But you can choose to add even more information to your content. You can do this by adding custom fields to your WordPress content.

To add new custom fields to your site, you can use dedicated plugins like Advanced Custom Fields. This way, you get to separate your content details into more areas than WordPress offers by default.

For example, you may have a WordPress movie review website. By default, WordPress allows you to add metadata fields like titles, tags, and categories to your posts. But with custom fields, you can add more details like rating, genre, and producer.

custom fields for WordPress movie review website

So, WordPress will include these information fields each time you’re adding a movie review to your site.

This makes it easy to maintain the same styling and formatting across all your movie review posts. Custom fields can also come in handy for many other purposes like user account management and WooCommerce inventory management.

At this point, you should already understand what custom fields are and how we use them in WordPress. Now, let’s talk about why custom fields search is important.

Why Add Custom Fields Search to WordPress?

WordPress custom fields help you to add more information to your site content. With WordPress custom fields search, your site can index and search these extra information fields.

This means your WordPress site users can now look for search results in more ways than before. This automatically improves your site search and makes it more flexible.

For example, you can have a movie review site with custom fields like ‘Genre’ and ‘Producer’. With custom fields search, a site visitor can easily type a producer’s name in the search bar. Your site will then display all the movie reviews from that producer.

WordPress custom field search results for producer

This makes it super easy for your readers to navigate your movie review site.

You may also have a WooCommerce store with custom fields like ‘Brand’ and ‘Manufacturing Year’. Your site users can easily use a custom search form to find products from a specific brand or manufacturing year.

WordPress Custom fields search results for car brand

If you’ve already added custom fields to WordPress, you can easily use a plugin to add a WordPress search form with custom fields. This option is the fastest way to search your WordPress posts by custom fields.

Unlike adding custom code to your site manually, when you use a WordPress plugin:

  • You get to save time.
  • You don’t need to be a WordPress guru.
  • You don’t need to pay a developer.

Let’s show you how to use a WordPress plugin to add advanced custom fields search to your site.

How to Add WordPress Custom Fields Search

Are you looking to add custom fields search in WordPress without writing any code? The easiest way to do this is to use a WordPress plugin like SearchWP.

SearchWP best WordPress search plugin

As the best WordPress search plugin, SearchWP allows your site visitors to search every custom field on your WordPress site. This can be super useful for finding the site content they need.

The tool integrates well with other plugins. So, even if you added custom fields with a third-party plugin, you can still index and search those custom fields.

Here are other features you get using SearchWP:

  • Search everything on your site. SeachWP is not limited to custom fields only. Unlike the default WordPress search, your site can look for search results everywhere.
  • Seamless WooCommerce integration. The plugin allows you to combine the power of WooCommerce and custom fields. This helps keep your online store as organized as possible. Even if you have thousands of products in your store, your visitors should be able to find products fast.
  • Site statistics and insights. SearchWP logs all your site visitors’ searches. This way, you can monitor what they’re looking for on your site. You can even use these statistics to decide whether your site needs custom fields search or not.

Now, let’s use SearchWP to add custom fields search to your WordPress site in 3 easy steps.

Step 1: Install and Activate SearchWP

To set your custom fields search, you can get started by grabbing your copy of the SearchWP plugin here.

After getting the plugin, you can download any of the 2 versions SearchWP shows you.

Click any of the available links to download the version you want. We always recommend the latest version for the best performance.

SearchWP plugin download links

After getting your copy of SearchWP, you’ll also receive an email containing your product key. Make sure you save this key to a notepad. You’ll use it to activate the plugin after logging into your WordPress dashboard.

Next, it’s time to upload the plugin to your WordPress site. Log into your WordPress admin area to do this.

If you need help with this, you can use this detailed step-by-step guide on how to install a WordPress plugin.

After installing and activating the plugin, the next thing to do is activate the product license.

You can do this by going to the settings page of the plugin. Click the new SearchWP navigation button at the top panel of your WordPress dashboard.

go to SearchWP settings page

Next, navigate to the License tab of the settings page and enter your product key from the email. Then click Activate.

Activate SearchWP license

Now that you’ve fully activated the plugin, let’s use it to set up custom fields search. You can do this by setting up your WordPress search engine.

Step 2: Add Custom Fields as Attributes in Your Search Engine

SearchWP uses search engines to help you customize your site search behavior. You can decide how your site looks for search results by simply making changes to the search engine.

A WordPress search engine works like a small Google search algorithm. It determines where to look for matches during site search and which content attributes to check first.

To add WordPress custom fields search, let’s start by adding sources to your search engine.

First, go to the SearchWP settings page by clicking the SearchWP button at the top of your dashboard.

go to SearchWP settings page

Next, you can either add a new search engine or edit the default one. To add a new search engine, click Add New.

Add new SearchWP search engine

Now, it’s time to choose your content sources where SearchWP should search for matches. Click Sources & Settings to do this.

SearchWP search engine sources and settings

Select as many sources as you want, then click Done.

Add sources to WordPress search engine

Next, add or remove content attributes from your WordPress search engine. This decides which content details to consider when your site is looking for results. WordPress uses content attributes to store information about your site content.

We’ll add custom fields as attributes in your search engine. To do this, click Add/Remove Attributes.

Add or remove attributes from SearchWP search engine sources

On the next pop-up that appears, select all the custom fields you want to add to your WordPress search. SearchWP will show you all the available custom fields, no matter the plugin you used to add them.

You can select several other attributes. Then click Done.

Add custom fields as attributes to WordPress search engine

You can also rank each custom field value according to how relevant you want it to be. Each value has a slider you can adjust to suit your needs. For example, you can rank the movie genre higher than the summary. So, SearchWP will first check the genre for results before looking in the summary.

Rank custom field attributes according to relevance

Finally, click Save Engines at the top right corner of your dashboard.

Save SearchWP search engine settings

SearchWP will now start applying your new changes by building a new search index.

Congratulations! You’ve successfully added custom fields search to your WordPress site.

Now, let’s test if everything works fine on the user’s end.

Step 3: Test Your New Custom Fields Search

To see how effective your WordPress custom fields search is, click Visit Site. You can find the button at the top left corner of your dashboard after hovering over your site name.

WordPress visit site

On the front-end, type a custom field value in the search bar and click Search. For example, ‘Sci-fi’ is one of the values we added to the ‘Genre’ custom field in this tutorial. Your site should then show you relevant search results like this.

Wordpress custom fields search results

In this article, you’ve learned how to add custom fields search in WordPress.

You can use this to improve your site search and help users search your site in different ways.

Are you ready to add custom fields search to your WordPress site? Get started with SearchWP here.

You can also check these guides to learn how to make WordPress search PDF files or how to fix WordPress search not working.

Want to make your search awesome right now?

More than 30,000 sites have chosen SearchWP!

You can utilize all of the content that’s gone unrecognized by native WordPress keyword search instantly with SearchWP.

Get SearchWP for just $99

  • Committed Support
    If you need help, support is fast, friendly, and here for you
  • Streamlined Setup
    Installation and setup that’s optimized for speed
  • Great Documentation
    Helpful, clear, and usable documentation is a priority

See what SearchWP customers have to say

  • “SearchWP combines an incredible amount of flexibility with a design that makes it easy to use. Its power lies in the near infinite level of customization. Literally every aspect of your content can be assigned a level of importance.”

  • “I love this plugin and i love the custom and personal support including custom code that I’ve received”

  • “2 things I’ve done based on data from SearchWP: create content people searched for that was missing, and customize results for important terms. Being able to see search data and customize results has been awesome!”