How to clear “Used variables” that don’t exist in the file anymore?

Same problem! Please find a solution to easily remove them completely!

i found solution with dead instances of used variables. First of all Figma didn’t respect hidden layers for “detaching deleted variables” as “reset variable modes in selection”, Figma also dont show hidden layer color in selected colors panel since hidden layers not selected.

Also this dead or old hidden layers across components forse Figma to show old/dead modes.

So to get rid of dead modes you need

  1. Select all in page
  2. Reset variable modes in selection.
  3. Detach deleted variables.
    wait till Figma did a thing and after that wait for Figma did all background updates.
  4. Check if “Dead mode” was removed (in my case it removed in 90% cases).
  5. if “Dead mode” still exist > look for hidden layers and remove them or reconnect to correct variable.

i get rid of Dead mode for about 30 min with this steps.
Enjoy

My ghost variables came down a button where I had deleted the master component, but had a modified version in my library. When I restored the component master, removed ghost variables, it all cleaned up for me.

But a more robust way of finding ghost variables would be appreciated.

I deleted every page, but there are still two ‘Used variables’ collections in this file. It’s really frustrating.

The same issue here it is still in UI3. I tried the quick command but it does not work.
I am still facing this Ghost variable issue Does anyone know how to remove them? Will appreciate thanks

image

yeah it is kind of ridiculous that after 2y this bug still exists … some heavy flaws in the modelling here …

2 Likes

Please, Figma, Fix this issue. I want to copy components from a file to another and it’s impossible to make it without importing a full set of ghost variables. I’ve tried to use a “bridge new document” where I remove manually all the variables, and then, copy and paste the components in the Figma file I need… and variables are still in there. No makes sense at all.

I’m trying to be creative: I created a history version point. Then import the components, remove manually the variables of every single layer. Once all the layers have any link with any variable, copy all the components again. After that, I restored the history version I created previously and paste the cleaned components… And it seems to work but some layers are removed and don’t appear. It’s clear that you have a real bug with this.