feat(frontend): Skip consent manager scripts for search engine bots#478
Closed
Copilot wants to merge 2 commits into
Closed
feat(frontend): Skip consent manager scripts for search engine bots#478Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: skerbis <791247+skerbis@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add noindex for internal scripts as requested by customer
feat(frontend): Skip consent manager scripts for search engine bots
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
content="noindex"is not valid on<script>tags and Googlebot executes JavaScript regardless of custom attributes. The correct SEO mitigation is to detect crawlers by User-Agent and skip delivering the consent manager output entirely.Changes
lib/Utility.php— newUtility::isBot()static method:preg_quote()to safely escape each pattern before regex assembly$userAgentstring; falls back toHTTP_USER_AGENT@apifragments/ConsentManager/box_cssjs.php— early return for bots:Placed after the existing guard checks, this skips all CSS/JS output — including Google Consent Mode scripts — when the visitor is identified as a crawler.
Original prompt
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.