diff --git a/redfish-core/include/utils/sensor_utils.hpp b/redfish-core/include/utils/sensor_utils.hpp
index de1998d..41c14fc 100644
--- a/redfish-core/include/utils/sensor_utils.hpp
+++ b/redfish-core/include/utils/sensor_utils.hpp
@@ -515,7 +515,10 @@
             unit = "/Reading"_json_pointer;
             sensorJson["ReadingUnits"] = thermal::ReadingUnits::RPM;
             sensorJson["@odata.type"] = "#Thermal.v1_3_0.Fan";
-            setLedState(sensorJson, inventoryItem);
+            if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)
+            {
+                setLedState(sensorJson, inventoryItem);
+            }
             forceToInt = true;
         }
         else if (sensorType == "fan_pwm")
@@ -523,7 +526,10 @@
             unit = "/Reading"_json_pointer;
             sensorJson["ReadingUnits"] = thermal::ReadingUnits::Percent;
             sensorJson["@odata.type"] = "#Thermal.v1_3_0.Fan";
-            setLedState(sensorJson, inventoryItem);
+            if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)
+            {
+                setLedState(sensorJson, inventoryItem);
+            }
             forceToInt = true;
         }
         else if (sensorType == "voltage")
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index aab95bd..e2fadba 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -671,7 +671,10 @@
         {
             if (std::ranges::find(interfaces2, interface) != interfaces2.end())
             {
-                getIndicatorLedState(asyncResp);
+                if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)
+                {
+                    getIndicatorLedState(asyncResp);
+                }
                 getLocationIndicatorActive(asyncResp, objPath);
                 break;
             }
@@ -764,16 +767,23 @@
         return;
     }
 
-    // TODO (Gunnar): Remove IndicatorLED after enough time has passed
     if (!locationIndicatorActive && !indicatorLed)
     {
         return; // delete this when we support more patch properties
     }
     if (indicatorLed)
     {
-        asyncResp->res.addHeader(
-            boost::beast::http::field::warning,
-            "299 - \"IndicatorLED is deprecated. Use LocationIndicatorActive instead.\"");
+        if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)
+        {
+            asyncResp->res.addHeader(
+                boost::beast::http::field::warning,
+                "299 - \"IndicatorLED is deprecated. Use LocationIndicatorActive instead.\"");
+        }
+        else
+        {
+            messages::propertyUnknown(asyncResp->res, "IndicatorLED");
+            return;
+        }
     }
 
     const std::string& chassisId = param;
@@ -843,16 +853,19 @@
                                                   "LocationIndicatorActive");
                     }
                 }
-                if (indicatorLed)
+                if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)
                 {
-                    if (indicatorChassis)
+                    if (indicatorLed)
                     {
-                        setIndicatorLedState(asyncResp, *indicatorLed);
-                    }
-                    else
-                    {
-                        messages::propertyUnknown(asyncResp->res,
-                                                  "IndicatorLED");
+                        if (indicatorChassis)
+                        {
+                            setIndicatorLedState(asyncResp, *indicatorLed);
+                        }
+                        else
+                        {
+                            messages::propertyUnknown(asyncResp->res,
+                                                      "IndicatorLED");
+                        }
                     }
                 }
                 return;
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 7b22377..ed6c247 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -1832,7 +1832,10 @@
     powerSupply["Model"] = inventoryItem.model;
     powerSupply["PartNumber"] = inventoryItem.partNumber;
     powerSupply["SerialNumber"] = inventoryItem.serialNumber;
-    sensor_utils::setLedState(powerSupply, &inventoryItem);
+    if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)
+    {
+        sensor_utils::setLedState(powerSupply, &inventoryItem);
+    }
 
     if (inventoryItem.powerSupplyEfficiencyPercent >= 0)
     {
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index e006b9a..31cf897 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -3124,8 +3124,11 @@
             }
         });
 
-    // TODO (Gunnar): Remove IndicatorLED after enough time has passed
-    getIndicatorLedState(asyncResp);
+    if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)
+    {
+        getIndicatorLedState(asyncResp);
+    }
+
     getComputerSystem(asyncResp);
     getHostState(asyncResp);
     getBootProperties(asyncResp);
@@ -3220,6 +3223,15 @@
         return;
     }
 
+    if constexpr (!BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)
+    {
+        if (indicatorLed)
+        {
+            messages::propertyUnknown(asyncResp->res, "IndicatorLED");
+            return;
+        }
+    }
+
     if (assetTag)
     {
         setAssetTag(asyncResp, *assetTag);
@@ -3273,14 +3285,15 @@
             });
     }
 
-    // TODO (Gunnar): Remove IndicatorLED after enough time has
-    // passed
-    if (indicatorLed)
+    if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)
     {
-        setIndicatorLedState(asyncResp, *indicatorLed);
-        asyncResp->res.addHeader(boost::beast::http::field::warning,
-                                 "299 - \"IndicatorLED is deprecated. Use "
-                                 "LocationIndicatorActive instead.\"");
+        if (indicatorLed)
+        {
+            setIndicatorLedState(asyncResp, *indicatorLed);
+            asyncResp->res.addHeader(boost::beast::http::field::warning,
+                                     "299 - \"IndicatorLED is deprecated. Use "
+                                     "LocationIndicatorActive instead.\"");
+        }
     }
 
     if (powerRestorePolicy)
