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

Hi folks!

I used some components from other files in my project, and even though I removed them, I still see some Variables available in the “Page → Modes”. They are not available anywhere else. It doesn’t affect the project; when I select one, change the page, and then return to it, that mode is selected.

I checked my file, and nothing leads to the other file anymore – no styles, variables, components, etc.

It seems like a bug, and I see some variables pulled from another file, but can I remove it somehow?

image

Hey, sorry to hear this is happening! Please reach out to the support team directly via this form for help: https://help.figma.com/hc/en-us/requests/new

Be sure to use your Figma account email, include the links to your file, and share it with support-share@figma.com so they can take a closer look.

1 Like

That’s the thing with variables. Once assigned they stay there forever unless you break the link manually. Right the only way it to find rogue layers and remove bound var by hand, very frustrating.

1 Like

The problem is that there is no link between the “ghost” variables in my layers and pages.
Also, I don’t like that when you apply a mode to a page or a layer, there is no option to remove it - but here, I guess it’s the same as setting it to the “default” mode.

1 Like

Weird, but it’s gone now. I didn’t change anything, and when I returned to my computer today, I saw it’s not there anymore. So maybe the file needed to refresh, and it just took longer than it should?

I have the same issue. These variables are not used anywhere anymore, but they’re still there just like ghosts. Has anyone solved?

Hey All,

You can use the quick command: Detach deleted variables to quickly get rid of any existing ghost variables.

2 Likes

Thank you! I forgot about quick commands and was not aware that this command even exist :slight_smile:

1 Like

This seems doesn’t work for me. I copy radix color scales to my UI kit and even run the command to delete old variables it still there.

2 Likes

Sorry to hear that, @zu.nguyen! Our designer advocate, Miggi, shared this walk through last week:

Let us know if it helps!

A post was split to a new topic: Quick option to “Detach all variables”

Thanks for your feedback, @Dustin_Miller1!

We’re moving your idea to its own topic as a feature request, and we’ll pass this onto our Variables team for future consideration!

Hi, any new on that? I still have “used variables” despite having deleted “ghosts” variables.

quick commands not work for me
I duplicate the problem file and remove all page and everything but it still there

3 Likes

I have a similar problem, I removed all external variables links in my file but still have these external collections as “Used variable” in the mode dropdown menu… Quick command does not find anything

Still have the same issue, used variables are ghosts !!!

I have that same problem. It is not resolved in any way. annoying.

Same issue here. Tried the quick command but it does not work. I even see duplicated modes, with same values, in my file.

1 Like

Is there any chance for Figma to fix this? It’s a horror show trying to manage massive Design Systems. I already have to leverage Token Studio Plugin to manage and create my variables and themes. Would really like to see some updates to this. Also the YouTube tutorial is useful, but I’ve had literally empty files, that I’ve stripped clean with all kinds of plugins and the (Used variables) persist.

I’ve been practicing extreme file heigein to prevent contamination between old files and new yet it still happens. And now I can’t even use the version controls. I’ve gone back to file conception with the version control and the used variables are now persistent moving back.

I made a backup of my library the other day and imported it to my files and there was no issue. It only contained variables found in that file. Now if I import that same backup it also has the used variables. So not sure if this has something to do with published variables. Not sure because I’ve already unpublished my variables before importing the old save.

4 Likes

This still doesn’t work :frowning: