diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc
index 7330b3dc4c..5249698b30 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc
@@ -13,11 +13,12 @@
[% SET base_url = "/cgi-bin/koha/catalogue/search.pl?" _ query_cgi _ limit_cgi %]
[% FOREACH search_filter IN search_filters %]
+ [% SET search_filter_id = search_filter.id | uri %]
-
[% IF active_filters.${search_filter.id} %]
- [% search_filter.name | html %][x]
+ [% search_filter.name | html %][x]
[% ELSE %]
- [% search_filter.name | html %]
+ [% search_filter.name | html %]
[% END %]
[% END %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc
index 37aa75d823..924122c5d0 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc
@@ -11,11 +11,12 @@
[% SET base_url = "/cgi-bin/koha/opac-search.pl?" _ query_cgi _ limit_cgi %]
[% FOREACH search_filter IN search_filters %]
+ [% SET search_filter_id = search_filter.id | uri %]
-
[% IF active_filters.${search_filter.id} %]
- [% search_filter.name | html %][x]
+ [% search_filter.name | html %][x]
[% ELSE %]
- [% search_filter.name | html %]
+ [% search_filter.name | html %]
[% END %]
[% END %]