Turning off A/B testing in a staging/qa/dev environment is a common requirement to ensure stability and reproducibility during testing. Here’s a general guide on how to disable A/B testing for some popular platforms, including Growthbook.


Growthbook is designed with flexibility to enable or disable features like A/B testing easily. To turn off A/B testing in a staging environment, you can follow these steps:



Access the Growthbook admin dashboard and navigate to the configuration settings.


Environment Settings

Identify the environment settings specific to your staging environment. Feature Flags: Use feature flags to disable all experiments. You can create a specific feature flag that, when enabled, turns off all experiments in the staging environment. Code Modification: In your application code, check the value of the feature flag before running any experiment logic.

For example:

if (!growthbook.isFeatureEnabled("disableExperiments")) {
    // Run experiment logic

Environment Settings

Save your changes and deploy them to the staging environment. Make sure your staging environment configuration does not pull production experiment configurations.


Optimizely allows you to manage experiments across different environments:


Environment Setup

Log into your Optimizely dashboard and go to the environment settings.


Toggle Off Experiments

For the staging environment, you can toggle off all experiments manually or adjust the configuration to not run any experiments.


SDK Setup

Adjust the SDK initialization in your staging environment to either not include any active experiments or to ignore them. For example:

const optimizely = createInstance({
  sdkKey: "your_staging_sdk_key",
  datafileOptions: {
    autoUpdate: false,
    updateInterval: 0, // disable auto-fetching of datafile