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)
