# \#sql-triggered-badge

**URL:** https://meta.discourse.org/tag/sql-triggered-badge/616.md

[Latest](https://meta.discourse.org/latest.md) · [Categories](https://meta.discourse.org/categories.md) · [Tags](https://meta.discourse.org/tags.md)

---

## [Linking badge sql to a topic id?](https://meta.discourse.org/t/linking-badge-sql-to-a-topic-id/404943)

<div class="topic-metadata">

**Author:** [@Richie](https://meta.discourse.org/u/Richie)\
**Replies:** 3\
**Last updated:** [June 11, 2026, 12:48pm UTC](https://meta.discourse.org/t/linking-badge-sql-to-a-topic-id/404943 "2026-06-11T12:48:49Z")

</div>

I have this SQL in the settings of a badge and it awards a badge to anyone that gets added to the beta-testers group: SELECT u.id AS user\_id, CURRENT\_TIMESTAMP AS granted\_at FROM users u INNER JOIN group\_users gu ON gu.…

---

## [Creating triggered custom badge queries](https://meta.discourse.org/t/creating-triggered-custom-badge-queries/19336)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 0\
**Last updated:** [August 27, 2014, 8:42am UTC](https://meta.discourse.org/t/creating-triggered-custom-badge-queries/19336 "2014-08-27T08:42:47Z")

</div>

:bookmark: This guide explains how to create triggered custom badge queries in Discourse, including the types of badges, constraints for triggered badges, and an example query. :person\_raising\_hand: Required user level…

---

## [Change system for Bug Reporter badge?](https://meta.discourse.org/t/change-system-for-bug-reporter-badge/359421)

<div class="topic-metadata">

**Author:** [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**Replies:** 12\
**Last updated:** [February 24, 2026, 12:32pm UTC](https://meta.discourse.org/t/change-system-for-bug-reporter-badge/359421 "2026-02-24T12:32:13Z")

</div>

On Meta, sometimes we report bugs, and they get responded to by staff, with PRs to fix the bug we reported. However, if the staff member didn’t like the topic post, no badge is awarded, even though it has been acknowled…

---

## [Badge SQL triggered on post content](https://meta.discourse.org/t/badge-sql-triggered-on-post-content/394444)

<div class="topic-metadata">

**Author:** [@Alexander\_Wright](https://meta.discourse.org/u/Alexander_Wright)\
**Replies:** 1\
**Last updated:** [February 10, 2026, 2:32pm UTC](https://meta.discourse.org/t/badge-sql-triggered-on-post-content/394444 "2026-02-10T14:32:17Z")

</div>

I’m trying to award a badge depending on the content of a post. For example, If I type ‘Give Me A Badge’ i’m awarded the ‘Demanding’ badge. My SQL is as follows: SELECT p.user\_id, p.id post\_id, p.updated\_at granted\_at…

---

## [Need some Help with my Triggered Custom Badge Query](https://meta.discourse.org/t/need-some-help-with-my-triggered-custom-badge-query/395115)

<div class="topic-metadata">

**Author:** [@bisley](https://meta.discourse.org/u/bisley)\
**Replies:** 3\
**Last updated:** [February 5, 2026, 9:15am UTC](https://meta.discourse.org/t/need-some-help-with-my-triggered-custom-badge-query/395115 "2026-02-05T09:15:24Z")

</div>

Hi folks, I’m stuck on my SQL query. My goal / expectation is that it should grant a specific custom badge immediately when a user replies to a particular topic. The thing is I’m halfway there because the Daily “Backfil…

---

## [Add badge for adding profile picture](https://meta.discourse.org/t/add-badge-for-adding-profile-picture/386741)

<div class="topic-metadata">

**Author:** [@Steradiant](https://meta.discourse.org/u/Steradiant)\
**Replies:** 6\
**Last updated:** [October 25, 2025, 11:46pm UTC](https://meta.discourse.org/t/add-badge-for-adding-profile-picture/386741 "2025-10-25T23:46:35Z")

</div>

It would be a very nice incentive for people to add a profile picture if they would be granted a first-steps-badge when they do it the first time.

---

## [Badge for poll vote + topic post with min post likes?](https://meta.discourse.org/t/badge-for-poll-vote-topic-post-with-min-post-likes/281547)

<div class="topic-metadata">

**Author:** [@Tom\_Beckett](https://meta.discourse.org/u/Tom_Beckett)\
**Replies:** 0\
**Last updated:** [August 13, 2019, 10:14am UTC](https://meta.discourse.org/t/badge-for-poll-vote-topic-post-with-min-post-likes/281547 "2019-08-13T10:14:26Z")

</div>

Has anyone come up with a SQL statement or could give me an idea of whether the following is possible in awarding a badge? Responded to a poll with a specific number of answers (e.g. What things have you done to reduce…

---

## [Issue with disabling badge repetition](https://meta.discourse.org/t/issue-with-disabling-badge-repetition/370948)

<div class="topic-metadata">

**Author:** [@satonotdead](https://meta.discourse.org/u/satonotdead)\
**Replies:** 8\
**Last updated:** [July 16, 2025, 6:35pm UTC](https://meta.discourse.org/t/issue-with-disabling-badge-repetition/370948 "2025-07-16T18:35:05Z")

</div>

Disabling the option ‘Give this badge more than once’ is not working, at least with SQL-triggered badges. I have three badges with this option disabled that get triggered automatically many times. I had a very big issu…

---

## [Set badges to be auto granted?](https://meta.discourse.org/t/set-badges-to-be-auto-granted/373991)

<div class="topic-metadata">

**Author:** [@ice.d](https://meta.discourse.org/u/ice.d)\
**Replies:** 1\
**Last updated:** [July 12, 2025, 3:30pm UTC](https://meta.discourse.org/t/set-badges-to-be-auto-granted/373991 "2025-07-12T15:30:10Z")

</div>

As a member of the I saw that there are some badges that aren’t normally a discourse made badge that seems like it is auto granted such as this one below if I’m not mistaken it seems like this is an auto granted bad…

---

## [How to deal with multiples 'titles' on Automation](https://meta.discourse.org/t/how-to-deal-with-multiples-titles-on-automation/371273)

<div class="topic-metadata">

**Author:** [@satonotdead](https://meta.discourse.org/u/satonotdead)\
**Replies:** 1\
**Last updated:** [June 23, 2025, 2:16am UTC](https://meta.discourse.org/t/how-to-deal-with-multiples-titles-on-automation/371273 "2025-06-23T02:16:18Z")

</div>

When a user qualifies for multiple automated ‘title’ assignments (via badge groups), how is the definitive title determined? Is it possible to establish a hierarchy among these, perhaps through the order of SQL queries …

---

## [Grant Custom Badge Upon Reading ToS](https://meta.discourse.org/t/grant-custom-badge-upon-reading-tos/368259)

<div class="topic-metadata">

**Author:** [@TempAccount](https://meta.discourse.org/u/TempAccount)\
**Replies:** 7\
**Last updated:** [May 31, 2025, 3:18am UTC](https://meta.discourse.org/t/grant-custom-badge-upon-reading-tos/368259 "2025-05-31T03:18:38Z")

</div>

Continuing the discussion from How does the reader / read guideline badges work?: How would someone repurpose this for a custom badge, where the user will be automatically awarded upon reading the terms? Resource foun…

---

## [How to prevent accounts in anonymous mode from earning the SQL badge?](https://meta.discourse.org/t/how-to-prevent-accounts-in-anonymous-mode-from-earning-the-sql-badge/356345)

<div class="topic-metadata">

**Author:** [@copymonopoly](https://meta.discourse.org/u/copymonopoly)\
**Replies:** 0\
**Last updated:** [March 7, 2025, 7:54pm UTC](https://meta.discourse.org/t/how-to-prevent-accounts-in-anonymous-mode-from-earning-the-sql-badge/356345 "2025-03-07T19:54:25Z")

</div>

Temporary anonymous accounts are earning the SQL badge, especially some limited-edition badges, and this issue is really giving me a headache.

---

## [Create automatic badges](https://meta.discourse.org/t/create-automatic-badges/346592)

<div class="topic-metadata">

**Author:** [@CrazyCaliope](https://meta.discourse.org/u/CrazyCaliope)\
**Replies:** 1\
**Last updated:** [January 11, 2025, 12:42am UTC](https://meta.discourse.org/t/create-automatic-badges/346592 "2025-01-11T00:42:55Z")

</div>

So this may be a stupid question, but I’ve been searching through the numerous threads here and still don’t understand how. But how can I create automatic badges on my forum? I’m an admin and have created and granted m…

---

## [Badges for posting](https://meta.discourse.org/t/badges-for-posting/276725)

<div class="topic-metadata">

**Author:** [@PJH](https://meta.discourse.org/u/PJH)\
**Replies:** 4\
**Last updated:** [August 27, 2024, 12:41am UTC](https://meta.discourse.org/t/badges-for-posting/276725 "2024-08-27T00:41:41Z")

</div>

Since there deliberately isn’t the concept of achievements for posting, I’ve managed to implement it on ours, since we had it on our old forums and some were complain about the lack thereof. Generic version: SELECT use…

---

## [Badge for popular topic](https://meta.discourse.org/t/badge-for-popular-topic/309938)

<div class="topic-metadata">

**Author:** [@Shauny](https://meta.discourse.org/u/Shauny)\
**Replies:** 5\
**Last updated:** [June 1, 2024, 9:40am UTC](https://meta.discourse.org/t/badge-for-popular-topic/309938 "2024-06-01T09:40:29Z")

</div>

Is there a way to grant a badge to someone who created a topic which then got many replies? Say, 100 replies? I’d call it “Popular Topic” and it would encourage people to think of new topic ideas that will generate lots…

---

## [Badge based on when user was promoted to moderator first time?](https://meta.discourse.org/t/badge-based-on-when-user-was-promoted-to-moderator-first-time/303035)

<div class="topic-metadata">

**Author:** [@jrgong](https://meta.discourse.org/u/jrgong)\
**Replies:** 5\
**Last updated:** [April 24, 2024, 10:23am UTC](https://meta.discourse.org/t/badge-based-on-when-user-was-promoted-to-moderator-first-time/303035 "2024-04-24T10:23:39Z")

</div>

Hey guys! I tried search, but could not find anything. Is there any way to assign a badge based on how long a user has been a moderator? In our case, we have mods who have been an essential part of the team for many ye…

---

## [Badge query for each time posting on a new topic in a category?](https://meta.discourse.org/t/badge-query-for-each-time-posting-on-a-new-topic-in-a-category/301325)

<div class="topic-metadata">

**Author:** [@Shauny](https://meta.discourse.org/u/Shauny)\
**Replies:** 9\
**Last updated:** [April 21, 2024, 8:10am UTC](https://meta.discourse.org/t/badge-query-for-each-time-posting-on-a-new-topic-in-a-category/301325 "2024-04-21T08:10:01Z")

</div>

I have a badge that my members can earn multiple times, it is a “Book Club” badge - they are awarded it for discussing the book of the month. Each month, a new topic is created about the next book, and everyone replying…

---

## [Grant a badge based on number of bronze/silver/gold badges](https://meta.discourse.org/t/grant-a-badge-based-on-number-of-bronze-silver-gold-badges/291980)

<div class="topic-metadata">

**Author:** [@manuel](https://meta.discourse.org/u/manuel)\
**Replies:** 0\
**Last updated:** [January 17, 2024, 5:53pm UTC](https://meta.discourse.org/t/grant-a-badge-based-on-number-of-bronze-silver-gold-badges/291980 "2024-01-17T17:53:57Z")

</div>

You can use this query for custom member-level badges: SQL query SELECT user\_id, current\_timestamp granted\_at FROM user\_badges JOIN badges On user\_badges.badge\_id = badges.id WHERE badges.badge\_type\_id = 3 GROUP B…

---

## [Badges for 10 and 100 wiki edits across topics](https://meta.discourse.org/t/badges-for-10-and-100-wiki-edits-across-topics/291287)

<div class="topic-metadata">

**Author:** [@nathank](https://meta.discourse.org/u/nathank)\
**Replies:** 4\
**Last updated:** [January 12, 2024, 11:20am UTC](https://meta.discourse.org/t/badges-for-10-and-100-wiki-edits-across-topics/291287 "2024-01-12T11:20:44Z")

</div>

Continuing the discussion from The default badge queries: I’m trying to make a silver badge for 10 wiki edits (across all posts) and a gold badge for 100 wiki edits - however neither I nor the Forum Helper are getting …

---

## [Custom badge for trust level 0](https://meta.discourse.org/t/custom-badge-for-trust-level-0/290171)

<div class="topic-metadata">

**Author:** [@Farhan\_Hossen](https://meta.discourse.org/u/Farhan_Hossen)\
**Replies:** 3\
**Last updated:** [January 1, 2024, 2:02pm UTC](https://meta.discourse.org/t/custom-badge-for-trust-level-0/290171 "2024-01-01T14:02:30Z")

</div>

I’m trying to grant a badge to all the new users in my forum. I’m trying the following I see this preview But the badge is not assigned Oh and I don’t want the badge for users after reaching a higher trust le…

---

## [Badge for reading a page?](https://meta.discourse.org/t/badge-for-reading-a-page/287944)

<div class="topic-metadata">

**Author:** [@barto\_95](https://meta.discourse.org/u/barto_95)\
**Replies:** 0\
**Last updated:** [December 8, 2023, 9:40am UTC](https://meta.discourse.org/t/badge-for-reading-a-page/287944 "2023-12-08T09:40:14Z")

</div>

It’s possible to add a badge if user read the specific topic/subject of forum and not just opened the topic but he read ~5minutes to be sure the user read the info, My question is, it’s possible to do same for page like …

---

## [A silver badge for \_each\_ 5 bronze badges](https://meta.discourse.org/t/a-silver-badge-for-each-5-bronze-badges/283284)

<div class="topic-metadata">

**Author:** [@ganncamp](https://meta.discourse.org/u/ganncamp)\
**Replies:** 23\
**Last updated:** [November 10, 2023, 12:44pm UTC](https://meta.discourse.org/t/a-silver-badge-for-each-5-bronze-badges/283284 "2023-11-10T12:44:46Z")

</div>

We’ve created a bronze badge, Users Helping Users, for people trying to help other users. That’s granted manually (in order to tell the difference between attempts at being helpful and "me too"s). For each 5 bronze badg…

---

## [Using Reactions to grant badges](https://meta.discourse.org/t/using-reactions-to-grant-badges/284040)

<div class="topic-metadata">

**Author:** [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Replies:** 5\
**Last updated:** [October 31, 2023, 5:30pm UTC](https://meta.discourse.org/t/using-reactions-to-grant-badges/284040 "2023-10-31T17:30:25Z")

</div>

That sounds like an interesting way of achieving this, I would be interested in learning more if you ever want to share more details!

---

## [Badge for reading a topic?](https://meta.discourse.org/t/badge-for-reading-a-topic/281534)

<div class="topic-metadata">

**Author:** [@barto\_95](https://meta.discourse.org/u/barto_95)\
**Replies:** 6\
**Last updated:** [October 9, 2023, 10:01am UTC](https://meta.discourse.org/t/badge-for-reading-a-topic/281534 "2023-10-09T10:01:01Z")

</div>

It’s possible to add a badge if user read the specific topic/subject of forum ? and not just opened the topic but he read ~5minutes to be sure the user read the info ?

---

## [Encourage 'Notify Users' flag PMs](https://meta.discourse.org/t/encourage-notify-users-flag-pms/281549)

<div class="topic-metadata">

**Author:** [@manuel](https://meta.discourse.org/u/manuel)\
**Replies:** 1\
**Last updated:** [October 8, 2023, 7:12pm UTC](https://meta.discourse.org/t/encourage-notify-users-flag-pms/281549 "2023-10-08T19:12:43Z")

</div>

We want to encourage users to write more private messages about contentious or personal feedback on posts (and do it in a civil and friendly way..), rather than posting it public and possibly steering the conversation of…

---

## [Amending sample Gamification scoring badge](https://meta.discourse.org/t/amending-sample-gamification-scoring-badge/275737)

<div class="topic-metadata">

**Author:** [@satonotdead](https://meta.discourse.org/u/satonotdead)\
**Replies:** 1\
**Last updated:** [October 8, 2023, 7:52pm UTC](https://meta.discourse.org/t/amending-sample-gamification-scoring-badge/275737 "2023-10-08T19:52:02Z")

</div>

SELECT user\_id, current\_timestamp AS granted\_at FROM gamification\_scores WHERE (:backfill OR user\_id IN (:user\_ids)) GROUP BY 1 HAVING SUM(score) \> 9000 Can that query be limited by year, monthly or three months?

---

## [Leaderboard Top 50 (per month)](https://meta.discourse.org/t/leaderboard-top-50-per-month/281554)

<div class="topic-metadata">

**Author:** [@satonotdead](https://meta.discourse.org/u/satonotdead)\
**Replies:** 1\
**Last updated:** [October 8, 2023, 7:59pm UTC](https://meta.discourse.org/t/leaderboard-top-50-per-month/281554 "2023-10-08T19:59:38Z")

</div>

What about quering the \>50 (monthly) leaderboard members? That’s better than selecting overall cheers because it push the permanent contributions. That badge should enable an specific event in our instance …

---

## [Is it possible to have a badge for 100 solutions?](https://meta.discourse.org/t/is-it-possible-to-have-a-badge-for-100-solutions/281520)

<div class="topic-metadata">

**Author:** [@barto\_95](https://meta.discourse.org/u/barto_95)\
**Replies:** 6\
**Last updated:** [October 8, 2023, 1:19pm UTC](https://meta.discourse.org/t/is-it-possible-to-have-a-badge-for-100-solutions/281520 "2023-10-08T13:19:28Z")

</div>

It’s possible to add automatically badge on user have most 100 solved accept ?

---

## [What is the bug reporter badge?](https://meta.discourse.org/t/what-is-the-bug-reporter-badge/17987)

<div class="topic-metadata">

**Author:** [@sam](https://meta.discourse.org/u/sam)\
**Replies:** 33\
**Last updated:** [September 17, 2023, 12:33pm UTC](https://meta.discourse.org/t/what-is-the-bug-reporter-badge/17987 "2023-09-17T12:33:55Z")

</div>

You may or may have not noticed this new badge: https://meta.discourse.org/badges/114/bug-reporter What I find super exciting about it is that there are zero plugins needed, I crafted it using our badges UI. Not only d…

---

## [Badge for using Search](https://meta.discourse.org/t/badge-for-using-search/281545)

<div class="topic-metadata">

**Author:** [@packman](https://meta.discourse.org/u/packman)\
**Replies:** 0\
**Last updated:** [September 3, 2023, 1:35pm UTC](https://meta.discourse.org/t/badge-for-using-search/281545 "2023-09-03T13:35:02Z")

</div>

To encourage the use of search on my forum I’ve created badges for using the search function. I’ve created three badges (First \>=1, Great \>=50 and Epic \>=200) but you can choose how many badges and the values for yoursel…

[Next page](https://meta.discourse.org/tag/sql-triggered-badge/616.md?match_all_tags=true&page=1&tags%5B%5D=sql-triggered-badge)
