# Retire or replace a variable safely Deleting a variable that pages still show leaves \[unavailable\] in their text. Changing a type or moving a variable between space and global is not possible in place. Both are done the same way: point the pages somewhere else first, then retire the old variable. --- ## 1\. Find every page that uses it 1. Open the variable in the catalogue. 2. Select **Used on N pages that you can see**. Capable Search opens with every page that shows it. ⚠️ The count only includes pages **you** can see, and pages published in the last few minutes may not be counted yet. Ask a space administrator to check too if the space has restricted pages. --- ## 2\. Create the replacement (if you need one) Create a new variable with the type or scope you want, for example a **Number** instead of a **Text**, or a global variable instead of a space one. The new variable can have the same name if it is in a different scope. --- ## 3\. Repoint each page On each page, edit, open the macro's settings and click the replacement in **Choose a variable**. Or, if the value is no longer needed, delete the macro or type the value in as plain text. Publish. --- ## 4\. Retire the old variable When the usage line says **No pages that you can see use this variable**, select **Delete**. The confirmation repeats the count; if it is not zero, go back to step 1. Deleting moves the variable to the space trash. A space administrator can restore it from there if something was missed. --- ## A few things that catch people out * Renaming never needs any of this. Pages refer to the variable by ID, so a new name is safe. * Live docs are not counted in usage. Check any you know use the variable by hand. * Published Capable Sites keep the old value until you publish them again. --- ## Related ### [A variable says no pages use it, or shows no usage at all](https://help.gocapable.com/variables/a-variable-says-no-pages-use-it-or-shows-no-usage-at-all.html) When the count looks wrong. ### [The type cannot be changed](https://help.gocapable.com/variables/the-type-cannot-be-changed.html) Why the type is locked. ### [Details sidebar](https://help.gocapable.com/variables/details-sidebar.html) Value, usage and editing. --- _Repoint first, delete last._