Find all the pages having a particular slice?

Hi team,

Actually, I'm trying to refactor one slice which is present for a long time and I'm not exactly sure what are those pages where this particular slice is being used.

So what I'm trying to do is

  1. List down all the pages where this particular slice is present.
  2. Adjust the slice type definition. ( I mean refractor )
  3. Create a change-set.
  4. Schedule to publish the same.

I'm not sure I'm 100% correct in my approach and that is why I'm open to providing more info so that I can learn better approaches to doing the same.

Hope this makes sense and looking for your suggestions.


1 Like

Hi @aqib

Welcome to the Prismic community.

Yes, it seems the right way to go; I will keep this thread open in case someone in the community want to comment on this.

I asked a similar question a while back. I was simply looking to find every document using a particular slice (without refactoring) but someone on the Prismic team pointed us in the right direction with a sample script:

1 Like