diff --git a/modules/oe_whitelabel_search/oe_whitelabel_search.module b/modules/oe_whitelabel_search/oe_whitelabel_search.module
index 1624fd63c582513eb4247bad0b19a0f092a5dfaa..87a0f8cc1afb740fcf254eee3dd2207f682a534a 100644
--- a/modules/oe_whitelabel_search/oe_whitelabel_search.module
+++ b/modules/oe_whitelabel_search/oe_whitelabel_search.module
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * OE Whitelabel Search Module.
+ * Module file used for theming the search feature.
  */
 
 declare(strict_types =  1);
@@ -56,7 +56,7 @@ function oe_whitelabel_search_preprocess_facets_summary_item_list(array &$variab
  * Add suggestions based on the block region where the form is placed.
  */
 function oe_whitelabel_search_theme_suggestions_form_alter(array &$suggestions, array $variables): void {
-  if (empty($variables['element']['#form_id'])) {
+  if (!isset($variables['element']['#form_id']) || $variables['element']['#form_id'] !== 'oe_whitelabel_search_form') {
     return;
   }
 
@@ -70,7 +70,7 @@ function oe_whitelabel_search_theme_suggestions_form_alter(array &$suggestions,
  * Specify a suggestion for the form_element based on the form id.
  */
 function oe_whitelabel_search_theme_suggestions_form_element_alter(array &$suggestions, array $variables): void {
-  if (empty($variables['element']['#form_id'])) {
+  if (!isset($variables['element']['#form_id']) || $variables['element']['#form_id'] !== 'oe_whitelabel_search_form') {
     return;
   }