GET FREE VERSION GET THE PRO VERSION

ACF Search in WooCommerce: Find Products via Custom Fields

Michael B

Overview

This article explains how to enable search for WooCommerce products via Advanced Custom Fields (ACF) plugin fields. We will achieve this by using the Advanced Woo Search plugin. You’ll learn why the default WooCommerce search is limited, how to configure ACF search to find WooCommerce products via ACF fields, and how to troubleshoot common issues.

This guide is essential for anyone looking to extend WordPress search in ACF fields and create a more powerful and customized search experience.

Example of products search via ACF fields
Example of products search via ACF fields

What is ACF plugin and why to use it?

The ACF (Advanced Custom Fields) plugin allows you to add custom fields to your WordPress posts, pages, and custom post types, including WooCommerce products. These fields can store additional structured data such as product specifications, size guides, technical details, or custom labels.

For WooCommerce stores, ACF is especially useful when you need to store and display product-specific data that goes beyond default WooCommerce attributes. For example, you can use ACF to add fields like “GTIN”, “Manufacturer”, “Material”, or “Product Highlights”.

Keeping this in mind we see that ACF search can be very useful in terms of finding all products that contain ACF custom fields.

Example of ACF fields for WooCommerce products]
Example of ACF fields for WooCommerce products]

By default, WooCommerce search only checks the product title and content. This means you cannot search by ACF fields, SKU, GTIN, custom attributes, categories, or tags. As a result, customers may not find the right products even when they enter relevant queries.

To overcome these limitations, you can use the Advanced Woo Search plugin. It has many built-in features like:

  • Search by product custom fields, including ACF fields
  • Search by other fields like attributes, SKUs, GTINs, categories, tags, custom taxonomies, etc.
  • Live ajax search
  • Typo correction
  • Filters for search results
  • And many more...

As seen, the Advanced Woo Search plugin offers many very useful features, and due to its support for searching via ACF fields, it is an ideal solution for our case.

Why to Search for Products Via ACF Fields?

Searching by ACF fields allows customers to find products using specific custom data, which is especially important in stores that use non-standard product properties. This makes the search more relevant, helps improve conversions, and ensures a better overall user experience.

Example: Each of our WooCommerce products has a special parameter called Part Number, which consists of several groups of characters and digits like PL123445134. The first two characters represent the country of manufacturing and the rest is a unique product ID. We need an option to search for products via the whole Part Number field or only part of it (for example, to search for all products from a specific manufacturing country).

This is where ACF search becomes very useful. We just need to create a Part Number field, add it to all WooCommerce products, and enable searching via this field.

Part Number ACF field
Part Number ACF field
Part Number ACF inside product
Part Number ACF inside product

In such case, we will be able to search using the whole Part Number field or just part of it.

Search via Part Number field
Search via Part Number field
Search via part of Part Number field
Search via part of Part Number field

Below we will cover how to enable such product ACF search.

How to Enable WooCommerce Products Search via ACF Fields

As mentioned previously, to enable ACF search we will be using the Advanced Woo Search PRO plugin, which has built-in support for such search.

Promo banner
Advanced Woo Search
The best search solution for your WooCommerce store.

Steps to enable WooCommerce product search by ACF fields:

1. Install and activate the Advanced Woo Search PRO plugin.

After purchasing the plugin, you will receive an email with a .zip file. Download it. Then go to WordPress admin dashboard → Plugins → Add Plugin page and click the Upload Plugin button. Select the .zip file to upload and activate it.

Screen to upload Advanced Woo Search PRO plugin
Screen to upload Advanced Woo Search PRO plugin

2. Activate license key

Go to Adv. Woo Search → Updates page and activate your license key. The license key can be found in the same email with the plugin download files.

Field to activate plugin license key
Field to activate plugin license key

3. Configure index settings

Go to Adv. Woo Search → Performance tab. Find the Data to index option and enable the Custom Fields checkbox.

Field to enable products custom fields index
Field to enable products custom fields index

Then click on the gear icon near that field. On the next page, choose all needed ACF fields that must be searchable and enable them. In our example, it is Part Number, but it can be any field you choose.

Enable specific ACF field for index
Enable specific ACF field for index

4. Reindex plugin table

Go to the Adv. Woo Search main settings page, find and click the Reindex Table button. Wait until reindexing is finished (this may take time for stores with many products).

Reindex Table button
Reindex Table button

5. Configure search settings

Navigate to the desired search form settings → Search Results page and find the Search In option. Enable the Custom Fields option there.

Field to enable products custom fields search
Field to enable products custom fields search

Click on the gear icon next to it and select all the specific ACF fields you want to make searchable.

Enable specific ACF field for search
Enable specific ACF field for search

6. Check search results

We’re done! Now just save all changes and test your search via ACF field. All products with the matching ACF field values should appear in the search results.

Search for products via ACF field
Search for products via ACF field

What Types of ACF Fields Is Supported For Searching?

The Advanced Woo Search plugin supports a wide range of ACF field types for searching, including:

- Text
- Textarea
- Number
- Select
- Radio Button
- True/False
- Repeater (text values)
- Flexible content (text values)

Full list of supported ACF fields can be found here: https://advanced-woo-search.com/guide/acf-support/#types

No matter what type of ACF field it is - just enable the needed one for searching as described above - and you are ready to go. Simple and powerful.

Common Pitfalls and Troubleshooting

ACF fields not being indexed: Make sure the desired ACF fields are selected under the “Data to index” settings and reindex the table.

Search results not updating: Click the Reindex Table button again after making changes to your products or ACF configuration.

Caching issues: Clear your site and object cache after updating plugin settings or reindexing. Also go to the plugin’s Performance tab and click the 'Clear cache' button to clear the plugin's search results cache.

Compatibility with other plugins: Ensure there are no conflicts with other search-related or performance plugins. Disable them temporarily to isolate any issues.

Conclusion

WooCommerce’s default search is limited and doesn’t support searching in ACF fields. By combining WooCommerce with ACF and the Advanced Woo Search plugin, you can enable powerful, customized search functionality. This improves product discoverability and overall user satisfaction.

FAQ

Can I search only via specific ACF fields and not by all?

Sure. Inside the 'Search In' option, you can choose which ACF fields to make searchable and which to exclude.

Can I display ACF field values inside search results?

Yes, it’s possible, but requires custom code snippets. More details can be found here.

Can I filter my search results by certain ACF fields?

Yes. We have a separate blog post on this topic - How to Create WooCommerce Search Results Filters Based on ACF Fields.

Can I search for product variations via ACF fields?

Yes, you can search for both parent and variation products via ACF fields. Advanced Woo Search PRO has built-in support for product variation search.

No, searching ACF fields requires the PRO version of the plugin.

Do I need to reindex every time I update a product’s ACF field?

No, the plugin syncs changes automatically. Reindexing is only needed after changing plugin settings or after initial plugin activation.

Comments

Download free version

Download free version from wordpress.org repository.

Purchase pro version

Read about differences between free and pro versions here.