A Reddit Devvit moderation app that detects URLs containing tracking parameters and helps moderators deal with them — quietly, reliably, and without pretending it can do things it can't.
Clean Links is free and open source (BSD-3-Clause), hosted at github.com/MisTraleuh/clean-links-reddit. Issues, ideas and pull requests are welcome.
These are Reddit Devvit platform constraints, not design choices. The app is built to be honest about what is and isn't possible, so moderators can trust its behavior.
Original link:
https://example.com/article?id=123&utm_source=reddit&utm_medium=social&fbclid=abc123
Bot reply:
Cleaned link:
https://example.com/article?id=123
The bot replies publicly with cleaned versions of tracked URLs. Original content is untouched.
Best for: Communities that want visible transparency about link hygiene.
The bot reports the post or comment to the mod queue with a configurable reason. No public comment is posted. This is the quietest mode — users never see any bot activity.
Best for: Large communities, communities that want zero bot noise, or moderators who want to review tracked URLs before taking action.
The bot removes the post and replies with the cleaned link. Only applies to posts — comments are never removed.
Best for: Communities with strict link policies where tracked URLs should not stay visible.
The bot detects tracked URLs and logs what it would do, but takes no action. No comments, no reports, no removals.
Best for: Testing the app after installation, or auditing link hygiene before choosing a mode.
| Priority | Recommended mode |
|---|---|
| Zero noise, mod-only workflow | report_to_mods |
| Transparent, visible cleaning | comment |
| Strict enforcement | remove_posts |
| Testing / evaluation | dry_run |
Removed by default:
utm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_idfbclid (Facebook), gclid (Google), msclkid (Microsoft)igsh (Instagram)ref_src, tracking_id, mc_cid, mc_eid, s_idDomain-scoped (only stripped on matching sites):
si — YouTube, Spotify onlyref — Amazon onlysession, sessionid, session_id, sid, phpsessid, jsessionid, referrer, click_id, clickidCustom parameters can be added via settings.
| Setting | Type | Default | Description |
|---|---|---|---|
| mode | select | comment | Moderation mode |
| scan_selftext | boolean | true | Scan post body text for URLs |
| scan_link_posts | boolean | true | Scan link post URLs |
| scan_comments | boolean | true | Scan comment bodies for URLs |
| comment_on_posts_only | boolean | false | In comment mode, only reply to posts (not comments) |
| ignore_bots | boolean | true | Skip bot accounts (name-based heuristic) |
| ignore_automoderator | boolean | true | Skip AutoModerator |
| max_links_per_item | number | 10 | Max cleaned links per action |
| compact_above | number | 5 | Use compact summary when link count exceeds this |
| custom_tracking_params | string | "" | Additional params to strip (comma separated) |
| allowlist_domains | string | "" | Only process these domains |
| denylist_domains | string | "" | Ignore these domains |
| include_footer | boolean | true | Add explanation footer to bot comments |
| custom_footer_message | paragraph | "" | Custom text that replaces the default footer note (Markdown + placeholders) |
| notify_author | boolean | false | Also send the explanation to the author by private message |
| report_reason | string | (default) | Reason string for report_to_mods mode |
By default, bot comments end with a short generic note:
---
*Tracking parameters were removed from the original URL(s).*
Most users strip tracking params involuntarily — they hit the platform's
share button, paste the result, and have no idea why a link looks "off". The
custom_footer_message setting lets moderators replace that generic note with
their own explanation, so users learn how to avoid the issue without a manual
mod-mail follow-up.
Example custom message:
---
Heads up — your link contained tracking parameters, so here's a clean version.
This usually happens when you use the in-app **Share** button. Next time, copy
the URL straight from your browser's address bar and it'll stay clean. Thanks!
Notes:
include_footer to be enabled. When the message is empty, the
default note is used.The custom message (and the DM message below) supports placeholders that are expanded per action:
| Placeholder | Expands to |
|---|---|
{author} |
u/<username> of the post/comment author (or "the author") |
{subreddit} |
r/<name> of the community (or "this community") |
{count} |
number of cleaned links in this action |
{cleaned_link} |
the user's actual first cleaned URL |
{dirty_link} |
the user's actual first original (dirty) URL |
{cleaned_links} |
newline-separated list of the cleaned URLs |
{dirty_links} |
newline-separated list of the original (dirty) URLs |
The singular {cleaned_link} / {dirty_link} let you tailor instructions to
the user's real, immediate link instead of a confusing mockup. For example:
Your link
{dirty_link}had a tracking tag. The clean version is{cleaned_link}— copy that one from your browser's address bar next time.
Example: Hi {author}, we cleaned {count} link(s) in {subreddit}:\n{cleaned_links}
Unknown placeholders are left as-is, so a stray { never eats your text.
Most users never see the public bot comment — they post, move on, and only find
out something was off when a moderator mod-mails them. Enabling notify_author
sends the author a subreddit private message with the cleaned links and your
custom message (or a default explanation when none is set).
report_to_mods, it lets you educate users
privately with zero public bot noise.Every processed item is recorded in Redis (processed:post:{id}, processed:comment:{id}) with a 7-day TTL. The bot will never act on the same item twice, regardless of mode.
If upgrading from the previous 3-mode version:
report_to_mods mode — sends tracked URL detections to the mod queue with no public comment. This is the recommended mode for large or noise-sensitive communities.comment_on_posts_only setting — in comment mode, the bot can skip replying to comments while still replying to posts.compact_above setting — when many links are cleaned, the bot uses a shorter summary instead of listing every URL.report_reason setting — customize the reason string sent to the mod queue.custom_footer_message setting — replace the default footer note with a custom explanation tailored to your community (with {author}, {subreddit}, {count}, {cleaned_links} placeholders).notify_author setting — privately message the author the explanation, so users who never see the public comment still learn how to avoid tracking links.npm install # install dependencies
npm run type-check # tsc type-check
npm test # run the Vitest unit suite
npm run dev # devvit playtest on a test subreddit (requires devvit login)
The URL-cleaning, text-extraction, templating and comment-formatting logic are
pure functions with no Devvit dependency, covered by the tests in test/. The
Devvit runtime is stubbed in test/devvit-stub.ts so the suite runs in plain
Node.
This project is open source and contributions are welcome — bug reports,
feature ideas, and pull requests. Please run npm run type-check and
npm test before opening a PR.
Released under the BSD-3-Clause License. © Nathan Catalan (MisTraleuh).
__Asile34__
CreatorApp identifier
clean-links
Version
0.0.16
Last updated
Jun 21, 2026
Send feedback