# Hack for sorting Badges?

**URL:** https://meta.discourse.org/t/hack-for-sorting-badges/55656
**Category:** Support
**Tags:** badges
**Created:** [January 12, 2017, 5:09pm UTC](https://meta.discourse.org/t/hack-for-sorting-badges/55656 "2017-01-12T17:09:23Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Lutz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lutz/32/65103_2.png) [@Lutz](https://meta.discourse.org/u/Lutz)
#### Post date: [January 12, 2017, 5:09pm UTC](https://meta.discourse.org/t/hack-for-sorting-badges/55656/1 "2017-01-12T17:09:23Z")

</div>

Badges are becoming increasingly important on our pages. Is there a hack for sorting them, besides adding more badge groups? We have a lot of custom badges for xxx messages or xxx likes - so more groups are not really the way we want to go.

I’m open to any ideas, except patching the code - that’s currently going beyond my possibilities.

---

<div class="post-metadata">

### Author: ![Lutz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lutz/32/65103_2.png) [@Lutz](https://meta.discourse.org/u/Lutz)
#### Post date: [January 16, 2017, 2:44am UTC](https://meta.discourse.org/t/hack-for-sorting-badges/55656/2 "2017-01-16T02:44:26Z")

</div>

In case someone needs it, there is way to sort the badges inside a single Badge-Group.

You need to add more rows to the table “badge\_types”. Lower Id’s will be sorted to the end of the list.  
Lets say you need to sort 5 Badges in one Badge-Group (they are from the table badge\_groupings). You could edit the table “badge\_types” as follow:

- row-id 1: name “Diamond”
- row-id 2: name “Platin”
- row-id 3: name “Gold”
- row-id 4: name “Silver”
- row-id 5: name “Bronze”

Then set your badges to the type you want. They will be displayed from Bronze → Diamond on the /badges and /users/[username]/badges page.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 21, 2019, 1:38pm UTC](https://meta.discourse.org/t/hack-for-sorting-badges/55656/3 "2019-04-21T13:38:39Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 23, 2019, 7:47am UTC](https://meta.discourse.org/t/hack-for-sorting-badges/55656/4 "2019-04-23T07:47:25Z")

</div>

Hmmm curious what ended up happening here? What modifications did you make?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 27, 2022, 11:56pm UTC](https://meta.discourse.org/t/hack-for-sorting-badges/55656/5 "2022-07-27T23:56:28Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 28, 2022, 2:10am UTC](https://meta.discourse.org/t/hack-for-sorting-badges/55656/7 "2022-07-28T02:10:05Z")

</div>


