# How is the "top" order determined

**URL:** https://meta.discourse.org/t/how-is-the-top-order-determined/57890
**Category:** Site feedback
**Created:** [2월 24, 2017, 11:21오전 UTC](https://meta.discourse.org/t/how-is-the-top-order-determined/57890 "2017-02-24T11:21:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Rob\_Nicholson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_nicholson/32/63483_2.png) [@Rob\_Nicholson](https://meta.discourse.org/u/Rob_Nicholson)
#### Post date: [2월 24, 2017, 11:21오전 UTC](https://meta.discourse.org/t/how-is-the-top-order-determined/57890/1 "2017-02-24T11:21:36Z")

</div>

What’s the logic used to determine the default order of top topics? Why is “Discourse’s Fourth Birthday” above “Custom Layout Plugin” when the later has had more replies, more views and more recent activity?

 ![](https://global.discourse-cdn.com/meta/original/3X/a/b/ab5e5e64acd5beae2e2269a25e6ef643f6ffb1f0.png)

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2월 24, 2017, 12:17오후 UTC](https://meta.discourse.org/t/how-is-the-top-order-determined/57890/2 "2017-02-24T12:17:34Z")

</div>

You can see the explanation in the tooltip of the “top” menu. It says “the most active topics in the last year, month, week or day”.

> <https://github.com/discourse/discourse/blob/main/app/models/top_topic.rb#L252-L256>

As you can see Discourse calculating topic score for all the periods using the counting of posts, views, topic likes and post likes. And topics will be displayed in descending order of the `PERIOD_score`.

@sam I just noticed `quarterly_score` index is missing (or no need?) [here](https://github.com/discourse/discourse/blob/master/db/migrate/20150727210748_add_quarterly_to_top_topics.rb) while all other periods having their own score index. Yes I already know it will not affect the result.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2월 24, 2017, 12:34오후 UTC](https://meta.discourse.org/t/how-is-the-top-order-determined/57890/3 "2017-02-24T12:34:45Z")

</div>

Because likes to the first post are unusually weighted.. ask @sam about that. It was his choice.

---

<div class="post-metadata">

### Author: ![benraay](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@benraay](https://meta.discourse.org/u/benraay)
#### Post date: [5월 23, 2019, 10:11오전 UTC](https://meta.discourse.org/t/how-is-the-top-order-determined/57890/4 "2019-05-23T10:11:47Z")

</div>

Hi @codinghorror is there any way to change this by making a plugin or something ?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [5월 27, 2019, 9:22오후 UTC](https://meta.discourse.org/t/how-is-the-top-order-determined/57890/5 "2019-05-27T21:22:48Z")

</div>

You can change pretty much anything you want by writing a plugin 😉
