About archiving
LaunchDarkly considers flags ready to archive when they meet all of the criteria specified in the flag lifecycle settings. Before you archive a flag in LaunchDarkly, remove the flag from your code. If your application evaluates an archived flag, LaunchDarkly serves the flag’s fallback value, which is the value you defined in code. The code references feature can help you quickly identify all the places your code references a flag. To learn more, read Code references.Archiving a flag removes it from every environment in your projectAll flags exist in every environment for a project, but often only a few environments matter for your organization’s production processes. We recommend archiving all flags that are ready to archive in your critical environments. However, archiving a flag removes it from every environment in the project. Be certain you can archive a flag without any unintended impact.
Archive flags
You can filter the Flags list to find flags that are ready to archive. You can archive a flag from the Cleanup shortcut or from the flag’s right sidebar.Filter for flags that are ready to archive
To filter the Flags list for flags that are ready to archive:- In the left sidebar, click Code. The CodeControl menu appears.
- Click Flags.
- Open the Filters menu.
-
Under “Lifecycle,” select Ready to archive:

The project-level Filters menu, with "Ready to archive" selected.
Archive a flag from the Cleanup shortcut
The Cleanup shortcut is built in and available by default in every project. It lists the flags that are ready to archive. To archive a flag from the Cleanup shortcut:- In the left sidebar, click the Cleanup shortcut. A list of flags that are ready to archive appears.
- Find the flag to archive, then click its three-dot overflow menu.
-
Click Archive. The archive dialog appears:

The archive dialog.
- Review the archive checks to confirm that the flag is ready to archive. To learn more, read Archive checks.
- Enter a Comment to let other members in your organization know why you are archiving the flag.
- Click Archive.
Archive a flag from its right sidebar
To archive a flag from its right sidebar:- In the left sidebar, click Code. The CodeControl menu appears.
- Click Flags.
- Open the flag to archive.
- Click the three-dot overflow menu in the right sidebar.
-
Select Archive. The “Archive flag” panel appears.
- If the flag is a prerequisite for other flags, you cannot archive it. To learn more, read Archive checks.
-
Review any warnings. A warning displays for each critical environment in which the flag is not ready to archive. Click the warning message to show more information about why the flag is not ready to archive:

Warnings when archiving a flag.
- Enter a reason for archiving the flag.
- Click Archive.
Archive checks
LaunchDarkly runs three archive checks to confirm whether a flag is ready to archive:- The flag is a prerequisite for other dependent flags
- The flag is serving multiple variations
- The flag has been requested in the last seven days

A flag with dependencies that do not prevent you from archiving it.
View and restore archived flags
You can view archived flags from the Flags list, and restore an archived flag to return it to evaluation.View archived flags
By default, the Flags list shows live flags only. To view archived flags, click Filters from the Flags list and select Archived under “Lifecycle”:
The Flags list Filters, with the lifecycle options shown.
Restore an archived flag
When you restore a flag, LaunchDarkly evaluates it again like any other flag, instead of serving its fallback value to your application. To restore an archived flag:- In the left sidebar, click Code. The CodeControl menu appears.
- Click Flags.
- Click Filters. Under “Lifecycle,” select Archived. The archived flag list appears.
- Click the name of the flag to restore. The “Restore this flag” panel appears.
- Review recent evaluations of the flag shown in the panel. Choose the environments your team or customers depend on to confirm that restoring the flag will have no unexpected consequences.
- Enter a comment to explain why you are restoring the flag.
- Enter the name of the flag.
- Click Restore. The flag’s Targeting tab appears.
Delete an archived flag
If an archived flag is no longer in use, you can permanently delete it from the Flags list. Deleting a flag is permanent. Make sure your application no longer references it before you delete it. To learn more, read Deleting flags.You can also use the REST API: Delete feature flag API