# Discourse-Math badge

**URL:** https://meta.discourse.org/t/discourse-math-badge/160728
**Category:** Support
**Created:** [August 13, 2020, 12:32pm UTC](https://meta.discourse.org/t/discourse-math-badge/160728 "2020-08-13T12:32:03Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [August 13, 2020, 8:11pm UTC](https://meta.discourse.org/t/discourse-math-badge/160728/5 "2020-08-13T20:11:51Z")

</div>

> [@agf1997](#):
>
> Can anyone think of a way i could automatically grant a custom badge for making a post that renders an equation using the discourse-math plugin?

Yes, you can have badges for successful Math posts without having to modify the plugin.

First you will need to enable [Badge SQL can no longer be edited by default](https://meta.discourse.org/t/badge-sql-can-no-longer-be-edited-by-default/47894) on your site.

After that create a new badge that triggers on the following query:

```sql
SELECT user_id, MIN(id) AS post_id, current_timestamp AS granted_at 
FROM badge_posts
WHERE cooked LIKE '%<span class="math">%' AND (:backfill OR id IN (:post_ids) )
GROUP BY user_id

```

---

_[View the full topic](https://meta.discourse.org/t/discourse-math-badge/160728)._
