Bot mitigation for links facet

Created on 5 June 2025, about 1 month ago

Similar to 🐛 Render using theme input and select instead of lists with links for checkboxes and dropdown Needs review , many of our projects use the links facets and like many we struggle to keep the wave of naughty bots and crawlers at bay.

Attached is a patch for the 2.x branch of this module which remove the contents of the facet link href attribute and instead stores the href in a data attribute of the link.

The facet JS clicks the link as before, but uses the data attribute instead of the href directly.

We have had some success with this approach, so posting here for others.

Note:
- This does probably wreck accessibly for the links.
- The patch removes a version: VERSION line from the facet library yml file. This is so JS is properly re-aggregated (if you have aggregation enabled.

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇦🇺Australia thtas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024