> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Turning flags on and off

<View title="Developer" />

<View title="Federal docs" />

<View title="EU docs" />

This topic explains how to enable and disable flags in the LaunchDarkly platform.

<Tip>
  **The flag toggle button is a circuit breaker for any feature**

  The flag button lets you turn off a feature that's misbehaving without needing to touch any code or re-deploy your application. Wrap the entire feature in a feature flag to control or revoke its rollout seamlessly.
</Tip>

## Turn on flags

When you create a new flag, it is turned **Off** by default. You can turn the flag **On** by clicking the flag toggle button on the flag's **Targeting** tab.

To turn on a flag:

1. In the left sidebar, click **Code**. The CodeControl menu appears.

2. Click **Flags**.

3. Click on the name of the flag you want to turn on. The flag's **Targeting** tab opens.

4. Click on the tab for the environment you want to turn on the flag for. If the tab for the environment is not displayed, click the **+** to display the list of environments, and select the environment you want:

   <Frame caption="The environment selection menu.">
     <img src="https://mintcdn.com/launchdarkly/-b7nPh0oyigf6iW7/images/auto/environment-selection.auto.png?fit=max&auto=format&n=-b7nPh0oyigf6iW7&q=85&s=029e508024dee8be22f4f41658637a75" alt="The environment selection menu." width="592" height="322" data-path="images/auto/environment-selection.auto.png" />
   </Frame>

5. Click the flag toggle. The toggle turns green and displays the word **On**.

   <Frame caption="The flag toggle on the targeting tab.">
     <img src="https://mintcdn.com/launchdarkly/hutarVphEq2dY_zb/images/auto/flag-targeting-toggle-on.auto.png?fit=max&auto=format&n=hutarVphEq2dY_zb&q=85&s=f4fe790e27bc51c614a82fa3a15b24f2" alt="The flag toggle on the targeting tab." width="1878" height="124" data-path="images/auto/flag-targeting-toggle-on.auto.png" />
   </Frame>

6. Click **Review and save**.

To learn more about creating flags, read [Creating new flags](/docs/home/flags/new).

## Turn off flags

When you turn a flag to **Off**, you disable the targeting rules for that flag. Instead of serving an active variation, you serve the off variation.

On the flag's **Targeting** tab, you can set an off variation for both boolean and multivariate flags. Boolean feature flags default to `false` when the feature flag is **Off**.

To turn a flag **Off**:

1. In the left sidebar, click **Code**. The CodeControl menu appears.

2. Click **Flags**.

3. Click on the name of the flag you want to turn on. The flag's **Targeting** tab opens.

4. Click on the tab for the environment you want to turn off the flag for. If the tab for the environment is not displayed, click the **+** to display the list of environments, and select the environment you want:

   <Frame caption="The environment selection menu.">
     <img src="https://mintcdn.com/launchdarkly/-b7nPh0oyigf6iW7/images/auto/environment-selection.auto.png?fit=max&auto=format&n=-b7nPh0oyigf6iW7&q=85&s=029e508024dee8be22f4f41658637a75" alt="The environment selection menu." width="592" height="322" data-path="images/auto/environment-selection.auto.png" />
   </Frame>

5. Set the toggle to **Off**. The variation the flag will serve when you save your changes appears:

   <Frame caption="The &#x22;Off&#x22; value for a flag.">
     <img src="https://mintcdn.com/launchdarkly/hutarVphEq2dY_zb/images/auto/flag-targeting-toggle-off.auto.png?fit=max&auto=format&n=hutarVphEq2dY_zb&q=85&s=69e57ef1c3209c6224bb50bbc1cf2743" alt="The &#x22;Off&#x22; value for a flag." width="1878" height="124" data-path="images/auto/flag-targeting-toggle-off.auto.png" />
   </Frame>

6. Click **Review and save**.

If you do not specify an explicit default off variation, LaunchDarkly serves the [fallback value](/docs/home/getting-started/vocabulary#fallback-value) for the flag. You can specify the fallback value in your code's variation calls. View the fallback value in the flag's **Targeting** tab.

<Tip>
  **Planning feature flags for future events**

  You can schedule a flag for a particular date using scheduled flag changes, or you can use targeting rules to control what it affects and when. For example, you can serve `false` to deprecate a feature after a date of your choosing, or you can target a specific context or segment to be removed from the flag's targeting settings. To learn more, read [Target with flags](/docs/home/flags/target).
</Tip>

## Watch for changes in your application

When you turn a flag on and off, you should immediately see the corresponding changes in your application. You can try this yourself by following the in-app [Quickstart](/docs/home/getting-started) or running `ldcli setup` in the [LaunchDarkly CLI](/docs/home/getting-started/ldcli).

If you do not see changes in your application when you turn the flag on and off, try checking the following:

* **Does your SDK successfully initialize?** Look in your application logs for a message that says `SDK successfully initialized`. If you find `SDK failed to initialize` instead, check your SDK credentials. You may be using an invalid SDK key, mobile key, or client-side ID.
* **Does your application use a valid feature flag key and SDK credential?** If you are using the in-app [Quickstart](/docs/home/getting-started) or running `ldcli setup` in the [LaunchDarkly CLI](/docs/home/getting-started/ldcli), the flag key and SDK key, mobile key, or client-side ID for your environment are automatically inserted into the sample code that you are prompted to copy. If you are working directly from one of our [Sample applications](/docs/sdk/concepts/sample-applications), you will need to do this manually. Review the README file in the sample application repository for details on where to update your flag key and SDK credential.
* **Does your organization's network close long-lived streaming connections?** You will not see flag updates if you are no longer connected to LaunchDarkly. Try restarting your application to re-open the connection. If this solves the problem, work with your organization to allow longer-lived streaming connections.
* **Does your organization's network use an https proxy?** If all of your network traffic is going through a proxy, your application may take longer to update when you turn flags on and off.
* **Does your organization's network require additional authorization to allow outbound connections?** For example, some organizations require [bearer authentication](https://swagger.io/docs/specification/authentication/bearer-authentication/) for outbound traffic. You may need to update your application code to include this authorization.
