How do I filter products by template (in admin)?

From Admin > Products I need to be able to see which products have a particular template. However I only see these options for filtering:

MDJ1_0-1681995834704.png

It’s important to filter by template as some of our templates deliberately do not show an add to cart button, and we need to periodically check that nothing has been assigned those templates incorrectly.

I know it’s possible using apps such as Matrixify, but I’d really rather be able to do it from Shopify Admin, seeing as templates are a core Shopify feature.

Hi @MDJ1 If you have less products then you can check manually opening product backend one by one and check the template name make sure it is Default Product template selected if there is another name template found then you can easily fix your issue by changing the template.

Sure, but I have around 1000 products so that would take a long time :slightly_smiling_face:

Really there should be a way to filter at Admin > Products, just like we can filter by vendor, product type etc.

@MDJ1 Yeah i understand there are 1000 products but in the Shopify there is no filter type is exist for finding products by Theme Template. There are only few filters are available like - Sales Channel, Product Type, Collection, Gift Card, Product Vendor, Tagged, Status etc.

A roundabout way that I’ve been able to see which products are using a certain page template is in the Theme Editor.
On that particular template, in the sidebar near the top there’s a “Preview” block and there’s the linked text “Change.”
If you click that, you can toggle to the “Assigned” tab and see all the products using this template.

Sorry I’d missed this response…

Thank you - that’s ingenious!

Using the free shopify graph api app “Shopify GrphiQL App” you can query the products like this:

{
products(first: 100) {
edges {
node {
id
title
templateSuffix
}
}
pageInfo {
hasNextPage
endCursor
}
}
}

Using the free “Shopfy GraphiQL App” one can use the shopify Graph API like this:

  1. Query All Products with Their Template Suffixes: Use the products connection to fetch each product’s templateSuffix. Due to potential rate limits and large datasets, it’s advisable to paginate through the products. Here’s an example query:

    { products(first: 100) { edges { node { id title templateSuffix } } pageInfo { hasNextPage endCursor } } }

    This query retrieves the first 100 products along with their templateSuffix. To fetch more products, use the endCursor from pageInfo to paginate through the list.

  2. Aggregate Unique Template Suffixes: After fetching the products, iterate through them to collect unique templateSuffix values. This will give you a list of all distinct product templates currently in use.

Note: The templateSuffix field indicates the template assigned to a product. If it’s null or an empty string, the product uses the default template.

For more details on the Product object and its fields, refer to Shopify’s GraphQL Admin API documentation.

Keep in mind that this method retrieves templates assigned to products. If you need a list of all available product templates in the store, including those not currently in use, you’ll need to access the store’s theme assets. This can be done using the REST Admin API’s Asset resource to list all template files in the theme. For more information, refer to the Shopify Community discussion on this topic.