diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control.cc b/modules/congestion_controller/goog_cc/goog_cc_network_control.cc
index e84d188..381345f 100644
--- a/modules/congestion_controller/goog_cc/goog_cc_network_control.cc
+++ b/modules/congestion_controller/goog_cc/goog_cc_network_control.cc
@@ -73,22 +73,18 @@
   return !absl::StartsWith(config->Lookup(key), "Disabled");
 }
 
-BandwidthLimitedCause GetBandwidthLimitedCause(
-    LossBasedState loss_based_state,
-    bool is_rtt_above_limit,
-    BandwidthUsage bandwidth_usage,
-    bool not_probe_if_delay_increased) {
-  if (not_probe_if_delay_increased) {
-    if (bandwidth_usage == BandwidthUsage::kBwOverusing ||
-        bandwidth_usage == BandwidthUsage::kBwUnderusing) {
-      return BandwidthLimitedCause::kDelayBasedLimitedDelayIncreased;
-    } else if (is_rtt_above_limit) {
-      return BandwidthLimitedCause::kRttBasedBackOffHighRtt;
-    }
+BandwidthLimitedCause GetBandwidthLimitedCause(LossBasedState loss_based_state,
+                                               bool is_rtt_above_limit,
+                                               BandwidthUsage bandwidth_usage) {
+  if (bandwidth_usage == BandwidthUsage::kBwOverusing ||
+      bandwidth_usage == BandwidthUsage::kBwUnderusing) {
+    return BandwidthLimitedCause::kDelayBasedLimitedDelayIncreased;
+  } else if (is_rtt_above_limit) {
+    return BandwidthLimitedCause::kRttBasedBackOffHighRtt;
   }
   switch (loss_based_state) {
     case LossBasedState::kDecreasing:
-      return BandwidthLimitedCause::kLossLimitedBweDecreasing;
+      return BandwidthLimitedCause::kLossLimitedBwe;
     case LossBasedState::kIncreasing:
       return BandwidthLimitedCause::kLossLimitedBweIncreasing;
     default:
@@ -698,11 +694,9 @@
 
     auto probes = probe_controller_->SetEstimatedBitrate(
         loss_based_target_rate,
-        GetBandwidthLimitedCause(
-            bandwidth_estimation_->loss_based_state(),
-            bandwidth_estimation_->IsRttAboveLimit(),
-            delay_based_bwe_->last_state(),
-            probe_controller_->DontProbeIfDelayIncreased()),
+        GetBandwidthLimitedCause(bandwidth_estimation_->loss_based_state(),
+                                 bandwidth_estimation_->IsRttAboveLimit(),
+                                 delay_based_bwe_->last_state()),
         at_time);
     update->probe_cluster_configs.insert(update->probe_cluster_configs.end(),
                                          probes.begin(), probes.end());
diff --git a/modules/congestion_controller/goog_cc/probe_controller.cc b/modules/congestion_controller/goog_cc/probe_controller.cc
index 6139704..f0211d7 100644
--- a/modules/congestion_controller/goog_cc/probe_controller.cc
+++ b/modules/congestion_controller/goog_cc/probe_controller.cc
@@ -109,35 +109,23 @@
       allocation_probe_max("alloc_probe_max", DataRate::PlusInfinity()),
       min_probe_packets_sent("min_probe_packets_sent", 5),
       min_probe_duration("min_probe_duration", TimeDelta::Millis(15)),
-      limit_probe_target_rate_to_loss_bwe("limit_probe_target_rate_to_loss_bwe",
-                                          false),
       loss_limited_probe_scale("loss_limited_scale", 1.5),
       skip_if_estimate_larger_than_fraction_of_max(
           "skip_if_est_larger_than_fraction_of_max",
-          0.0),
-      not_probe_if_delay_increased("not_probe_if_delay_increased", false) {
-  ParseFieldTrial({&first_exponential_probe_scale,
-                   &second_exponential_probe_scale,
-                   &further_exponential_probe_scale,
-                   &further_probe_threshold,
-                   &alr_probing_interval,
-                   &alr_probe_scale,
-                   &probe_on_max_allocated_bitrate_change,
-                   &first_allocation_probe_scale,
-                   &second_allocation_probe_scale,
-                   &allocation_allow_further_probing,
-                   &min_probe_duration,
-                   &network_state_estimate_probing_interval,
-                   &probe_if_estimate_lower_than_network_state_estimate_ratio,
-                   &estimate_lower_than_network_state_estimate_probing_interval,
-                   &network_state_probe_scale,
-                   &network_state_probe_duration,
-                   &min_probe_packets_sent,
-                   &limit_probe_target_rate_to_loss_bwe,
-                   &loss_limited_probe_scale,
-                   &skip_if_estimate_larger_than_fraction_of_max,
-                   &not_probe_if_delay_increased},
-                  key_value_config->Lookup("WebRTC-Bwe-ProbingConfiguration"));
+          0.0) {
+  ParseFieldTrial(
+      {&first_exponential_probe_scale, &second_exponential_probe_scale,
+       &further_exponential_probe_scale, &further_probe_threshold,
+       &alr_probing_interval, &alr_probe_scale,
+       &probe_on_max_allocated_bitrate_change, &first_allocation_probe_scale,
+       &second_allocation_probe_scale, &allocation_allow_further_probing,
+       &min_probe_duration, &network_state_estimate_probing_interval,
+       &probe_if_estimate_lower_than_network_state_estimate_ratio,
+       &estimate_lower_than_network_state_estimate_probing_interval,
+       &network_state_probe_scale, &network_state_probe_duration,
+       &min_probe_packets_sent, &loss_limited_probe_scale,
+       &skip_if_estimate_larger_than_fraction_of_max},
+      key_value_config->Lookup("WebRTC-Bwe-ProbingConfiguration"));
 
   // Specialized keys overriding subsets of WebRTC-Bwe-ProbingConfiguration
   ParseFieldTrial(
@@ -484,29 +472,21 @@
   }
 
   DataRate estimate_capped_bitrate = DataRate::PlusInfinity();
-  if (config_.limit_probe_target_rate_to_loss_bwe) {
-    switch (bandwidth_limited_cause_) {
-      case BandwidthLimitedCause::kLossLimitedBweDecreasing:
-        // If bandwidth estimate is decreasing because of packet loss, do not
-        // send probes.
-        return {};
-      case BandwidthLimitedCause::kLossLimitedBweIncreasing:
-        estimate_capped_bitrate =
-            std::min(max_probe_bitrate,
-                     estimated_bitrate_ * config_.loss_limited_probe_scale);
-        break;
-      case BandwidthLimitedCause::kDelayBasedLimited:
-        break;
-      default:
-        break;
-    }
-  }
-  if (config_.not_probe_if_delay_increased &&
-      (bandwidth_limited_cause_ ==
-           BandwidthLimitedCause::kDelayBasedLimitedDelayIncreased ||
-       bandwidth_limited_cause_ ==
-           BandwidthLimitedCause::kRttBasedBackOffHighRtt)) {
-    return {};
+  switch (bandwidth_limited_cause_) {
+    case BandwidthLimitedCause::kRttBasedBackOffHighRtt:
+    case BandwidthLimitedCause::kDelayBasedLimitedDelayIncreased:
+    case BandwidthLimitedCause::kLossLimitedBwe:
+      RTC_LOG(LS_INFO) << "Not sending probe in bandwidth limited state.";
+      return {};
+    case BandwidthLimitedCause::kLossLimitedBweIncreasing:
+      estimate_capped_bitrate =
+          std::min(max_probe_bitrate,
+                   estimated_bitrate_ * config_.loss_limited_probe_scale);
+      break;
+    case BandwidthLimitedCause::kDelayBasedLimited:
+      break;
+    default:
+      break;
   }
 
   if (config_.network_state_estimate_probing_interval->IsFinite() &&
diff --git a/modules/congestion_controller/goog_cc/probe_controller.h b/modules/congestion_controller/goog_cc/probe_controller.h
index c8653b8..feec81f 100644
--- a/modules/congestion_controller/goog_cc/probe_controller.h
+++ b/modules/congestion_controller/goog_cc/probe_controller.h
@@ -71,14 +71,10 @@
   FieldTrialParameter<int> min_probe_packets_sent;
   // The minimum probing duration.
   FieldTrialParameter<TimeDelta> min_probe_duration;
-  // Periodically probe when bandwidth estimate is loss limited.
-  FieldTrialParameter<bool> limit_probe_target_rate_to_loss_bwe;
   FieldTrialParameter<double> loss_limited_probe_scale;
   // Dont send a probe if min(estimate, network state estimate) is larger than
   // this fraction of the set max bitrate.
   FieldTrialParameter<double> skip_if_estimate_larger_than_fraction_of_max;
-  // Do not send probes if either overusing/underusing network or high rtt.
-  FieldTrialParameter<bool> not_probe_if_delay_increased;
 };
 
 // Reason that bandwidth estimate is limited. Bandwidth estimate can be limited
@@ -86,7 +82,7 @@
 // estimate.
 enum class BandwidthLimitedCause {
   kLossLimitedBweIncreasing = 0,
-  kLossLimitedBweDecreasing = 1,
+  kLossLimitedBwe = 1,
   kDelayBasedLimited = 2,
   kDelayBasedLimitedDelayIncreased = 3,
   kRttBasedBackOffHighRtt = 4
@@ -142,11 +138,6 @@
   ABSL_MUST_USE_RESULT std::vector<ProbeClusterConfig> Process(
       Timestamp at_time);
 
-  // Gets the value of field trial not_probe_if_delay_increased.
-  bool DontProbeIfDelayIncreased() {
-    return config_.not_probe_if_delay_increased;
-  }
-
  private:
   enum class State {
     // Initial state where no probing has been triggered yet.
diff --git a/modules/congestion_controller/goog_cc/probe_controller_unittest.cc b/modules/congestion_controller/goog_cc/probe_controller_unittest.cc
index 6c02b3e..87c48ff 100644
--- a/modules/congestion_controller/goog_cc/probe_controller_unittest.cc
+++ b/modules/congestion_controller/goog_cc/probe_controller_unittest.cc
@@ -563,9 +563,7 @@
 }
 
 TEST(ProbeControllerTest, LimitAlrProbeWhenLossBasedBweLimited) {
-  ProbeControllerFixture fixture(
-      "WebRTC-Bwe-ProbingConfiguration/"
-      "limit_probe_target_rate_to_loss_bwe:true/");
+  ProbeControllerFixture fixture;
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
   probe_controller->EnablePeriodicAlrProbing(true);
@@ -627,7 +625,7 @@
      LimitProbeAtUpperNetworkStateEstimateIfLossBasedLimited) {
   ProbeControllerFixture fixture(
       "WebRTC-Bwe-ProbingConfiguration/"
-      "network_state_interval:5s,limit_probe_target_rate_to_loss_bwe:true/");
+      "network_state_interval:5s/");
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
 
@@ -706,9 +704,7 @@
 }
 
 TEST(ProbeControllerTest, ProbeInAlrIfLossBasedIncreasing) {
-  ProbeControllerFixture fixture(
-      "WebRTC-Bwe-ProbingConfiguration/"
-      "limit_probe_target_rate_to_loss_bwe:true/");
+  ProbeControllerFixture fixture;
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
   auto probes = probe_controller->SetBitrates(
@@ -732,9 +728,7 @@
 }
 
 TEST(ProbeControllerTest, ProbeFurtherInAlrIfLossBasedIncreasing) {
-  ProbeControllerFixture fixture(
-      "WebRTC-Bwe-ProbingConfiguration/"
-      "limit_probe_target_rate_to_loss_bwe:true/");
+  ProbeControllerFixture fixture;
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
   auto probes = probe_controller->SetBitrates(
@@ -764,16 +758,14 @@
 }
 
 TEST(ProbeControllerTest, NotProbeWhenInAlrIfLossBasedDecreases) {
-  ProbeControllerFixture fixture(
-      "WebRTC-Bwe-ProbingConfiguration/"
-      "network_state_interval:5s,limit_probe_target_rate_to_loss_bwe:true/");
+  ProbeControllerFixture fixture;
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
   auto probes = probe_controller->SetBitrates(
       kMinBitrate, kStartBitrate, kMaxBitrate, fixture.CurrentTime());
   probe_controller->EnablePeriodicAlrProbing(true);
   probes = probe_controller->SetEstimatedBitrate(
-      kStartBitrate, BandwidthLimitedCause::kLossLimitedBweDecreasing,
+      kStartBitrate, BandwidthLimitedCause::kLossLimitedBwe,
       fixture.CurrentTime());
 
   // Wait long enough to time out exponential probing.
@@ -789,9 +781,7 @@
 }
 
 TEST(ProbeControllerTest, NotProbeIfLossBasedIncreasingOutsideAlr) {
-  ProbeControllerFixture fixture(
-      "WebRTC-Bwe-ProbingConfiguration/"
-      "limit_probe_target_rate_to_loss_bwe:true/");
+  ProbeControllerFixture fixture;
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
   auto probes = probe_controller->SetBitrates(
@@ -815,7 +805,7 @@
 TEST(ProbeControllerTest, ProbeFurtherWhenLossBasedIsSameAsDelayBasedEstimate) {
   ProbeControllerFixture fixture(
       "WebRTC-Bwe-ProbingConfiguration/"
-      "network_state_interval:5s,limit_probe_target_rate_to_loss_bwe:true/");
+      "network_state_interval:5s/");
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
 
@@ -896,7 +886,7 @@
 TEST(ProbeControllerTest, DontProbeFurtherWhenLossLimited) {
   ProbeControllerFixture fixture(
       "WebRTC-Bwe-ProbingConfiguration/"
-      "network_state_interval:5s,limit_probe_target_rate_to_loss_bwe:true/");
+      "network_state_interval:5s/");
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
 
@@ -918,15 +908,15 @@
   EXPECT_LT(probes[0].target_data_rate, state_estimate.link_capacity_upper);
   // Expect that no more probes are sent immediately if BWE is loss limited.
   probes = probe_controller->SetEstimatedBitrate(
-      probes[0].target_data_rate,
-      BandwidthLimitedCause::kLossLimitedBweDecreasing, fixture.CurrentTime());
+      probes[0].target_data_rate, BandwidthLimitedCause::kLossLimitedBwe,
+      fixture.CurrentTime());
   EXPECT_TRUE(probes.empty());
 }
 
 TEST(ProbeControllerTest, ProbeFurtherWhenDelayBasedLimited) {
   ProbeControllerFixture fixture(
       "WebRTC-Bwe-ProbingConfiguration/"
-      "network_state_interval:5s,limit_probe_target_rate_to_loss_bwe:true/");
+      "network_state_interval:5s/");
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
 
@@ -958,7 +948,7 @@
      ProbeFurtherIfNetworkStateEstimateIncreaseAfterProbeSent) {
   ProbeControllerFixture fixture(
       "WebRTC-Bwe-ProbingConfiguration/"
-      "network_state_interval:5s,limit_probe_target_rate_to_loss_bwe:true/");
+      "network_state_interval:5s/");
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
   auto probes = probe_controller->SetBitrates(
@@ -1107,7 +1097,7 @@
      ProbeNotLimitedByNetworkStateEsimateIfLowerThantCurrent) {
   ProbeControllerFixture fixture(
       "WebRTC-Bwe-ProbingConfiguration/"
-      "network_state_interval:5s,limit_probe_target_rate_to_loss_bwe:true/");
+      "network_state_interval:5s/");
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
   probe_controller->EnablePeriodicAlrProbing(true);
@@ -1133,9 +1123,7 @@
 }
 
 TEST(ProbeControllerTest, DontProbeIfDelayIncreased) {
-  ProbeControllerFixture fixture(
-      "WebRTC-Bwe-ProbingConfiguration/"
-      "network_state_interval:5s,not_probe_if_delay_increased:true/");
+  ProbeControllerFixture fixture;
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
 
@@ -1162,9 +1150,7 @@
 }
 
 TEST(ProbeControllerTest, DontProbeIfHighRtt) {
-  ProbeControllerFixture fixture(
-      "WebRTC-Bwe-ProbingConfiguration/"
-      "network_state_interval:5s,not_probe_if_delay_increased:true/");
+  ProbeControllerFixture fixture;
   std::unique_ptr<ProbeController> probe_controller =
       fixture.CreateController();
 
