Is it possible to specify which metafields appear on certain product pages in the admin?

Solved

Is it possible to specify which metafields appear on certain product pages in the admin?

MadeByFrom
Shopify Partner
4 0 3

The store I am building has a wide variety of products with the product pages being heavy on product information (populated via metafields); however, the metafields required for some products don't apply to the rest of the products in my store. For example:

  • Product 1 - Facial Cleanser requires a metafield for benefits, ingredients, directions, etc.
  • Product 2 - Cleansing Brush requires a metafield for features, specs, package contents, etc.

Is there any way to specify which metafields appear on certain product pages in the admin? Or do all metafields need to appear for every single product on the site?

 

I hope this makes sense. Thanks!

Accepted Solution (1)
Ahmad31
Excursionist
19 3 0

This is an accepted solution.

I see what you're getting at! In Shopify's admin interface, the default behavior is to show all metafields for every product, which can be overwhelming if you have many metafields defined. However, as of now, Shopify does not provide a built-in way to conditionally hide metafields in the admin product page based on product type.

View solution in original post

Replies 6 (6)

Ahmad31
Excursionist
19 3 0

 

  • If you're using a Shopify theme that supports metafields, you can usually customize your product page templates to display specific metafields.
  • Go to Online Store > Themes and click on Customize.
  • Navigate to the product template and add the metafields you want to display. You can use Liquid code to conditionally show metafields based on whether they contain data.

{% if product.metafields.custom.benefits %}
<div class="product-benefits">
<h3>Benefits</h3>
<p>{{ product.metafields.custom.benefits }}</p>
</div>
{% endif %}

{% if product.metafields.custom.features %}
<div class="product-features">
<h3>Features</h3>
<p>{{ product.metafields.custom.features }}</p>
</div>
{% endif %}

 

MadeByFrom
Shopify Partner
4 0 3

I know that I can customize what is displayed on the front end of the site. I am talking about the product ADMIN.

I want to avoid showing every single metafield (potentially 20+ in my store) when only a few apply to each product type.

Ahmad31
Excursionist
19 3 0

This is an accepted solution.

I see what you're getting at! In Shopify's admin interface, the default behavior is to show all metafields for every product, which can be overwhelming if you have many metafields defined. However, as of now, Shopify does not provide a built-in way to conditionally hide metafields in the admin product page based on product type.

MadeByFrom
Shopify Partner
4 0 3

I figured as much. Thanks for the confirmation!

Ahmad31
Excursionist
19 3 0

You're welcome!

PaulNewton
Shopify Partner
7032 629 1481

Hi @MadeByFrom 👋 Currently no such feature for conditional metafield definition pinning.

Either a metafield definition is pinned and shows for all products, or unpinned and only show in the metafields list clicked through from the admin for the resources(products,collections,etc).

Make sure to file a feature request, https://help.shopify.com/en/support/support-type 

 

Some workarounds are: 

  • use metaobjects as a level of indirection for certain sets of metafields, but this will increase the number of clicks and page navigations, AND may require theme customizations
  • instead of the the shopify admin for product management use a different workflow such as spreadsheets, or a custom admin built through "low code"  internal-tool services such as retool, etc.
  • build a custom admin using the api
  • browser extensions, such as for user-styles,  to visually hide/show certain metafields that are pinned, but this can be fragile to make CSS or javascript to target the elements since if the admin is updated or changed by shopify the styles or javascript will stop working.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org