# How do you customize hot topic score algorithm with a plugin?

**URL:** https://meta.discourse.org/t/how-do-you-customize-hot-topic-score-algorithm-with-a-plugin/396003
**Category:** Development
**Created:** [February 13, 2026, 9:13am UTC](https://meta.discourse.org/t/how-do-you-customize-hot-topic-score-algorithm-with-a-plugin/396003 "2026-02-13T09:13:43Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [February 13, 2026, 9:58am UTC](https://meta.discourse.org/t/how-do-you-customize-hot-topic-score-algorithm-with-a-plugin/396003/2 "2026-02-13T09:58:34Z")

</div>

> [@fangjue](#):
>
> Monkey-patch `TopicHotScore` and update db according to our custom algorithm.

Easiest but might be limited depending on what you want to do.

> [@fangjue](#):
>
> Create a separate table to store topic hot scores and run a separate background job to update them. Add another route (instead of /hot) for our custom hot topic listing.

Doable but more complex. Have a look on [how TopicQuery implements lists](https://github.com/discourse/discourse/blob/7691be669a6a54175ee43c81d110b993e6de3a69/lib/topic_query.rb#L196-L395)

and specifically

```plaintext
  def list_hot
    create_list(:hot, unordered: true, prioritize_pinned: true) do |topics|
      topics = remove_muted(topics, user, options)
      topics.joins("JOIN topic_hot_scores on topics.id = topic_hot_scores.topic_id").order(
        "topic_hot_scores.score DESC",
      )
    end
  end

```

You can add an extra one relatively easily although there are quite some moving parts you need to take into account. I did that in my ‘[homepage-filter](https://github.com/communiteq/discourse-homepage-filter/blob/main/plugin.rb)’ plugin and that might be a good starting point.

---

_[View the full topic](https://meta.discourse.org/t/how-do-you-customize-hot-topic-score-algorithm-with-a-plugin/396003)._
