# Related / Similar Listings Algorithm Change

**URL:** <https://community.hivepress.io/t/related-similar-listings-algorithm-change/17961>\
**Category:** HivePress\
**Tags:** code\
**Created:** [September 3, 2026, 9:43pm UTC](https://community.hivepress.io/t/related-similar-listings-algorithm-change/17961 "2026-09-03T21:43:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur](https://community.hivepress.io/letter_avatar_proxy/v4/letter/a/958977/32.png) [@Arthur](https://community.hivepress.io/u/Arthur)\
**Post date:** [September 3, 2026, 9:43pm UTC](https://community.hivepress.io/t/related-similar-listings-algorithm-change/17961/1 "2026-09-03T21:43:31Z")

</div>

Hello,

I’m curious about how I can modify the algorithm/query of the Related Listings carrousel shown on the single listing page.

Right now, it seems a bit incomplete; for example, let’s say I have 3 items from the same category listed on the site and 2 of them have their main attribute (the brand) identical. In such a case, if I open one of the two which have the same brand, then the only related listing I see for that one is the third listing from the same category which has a different brand (so only one item shown, and not even the closest one).

The example is not that relevant though, as I would like to play a bit further with it. Therefore, could you please let me know where is the code responsible of this behaviour, or how I can change it?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [September 4, 2026, 3:45pm UTC](https://community.hivepress.io/t/related-similar-listings-algorithm-change/17961/3 "2026-09-04T15:45:13Z")

</div>

Hi,

A no-code solution for modifying the related listings would be to select the available option under HivePress \> Settings \> Listings and enable the Related option for the specific attribute in the attribute settings under the Display section.

It’s also possible to modify the related listings query using this hook: [Action: hivepress/v1/models/{model\_name}/relate | HivePress Hook Reference](https://hivepress.github.io/hook-reference/hivepress_v1_models_%257Bmodel_name%257D_relate.html).

It all depends on the type of the attribute. If it’s a select attribute, you need to add two underscores and an ID, for example, `__id()`, because `get_material` alone will return an array of objects.

You can also take a look at the snippet and the discussion here: [Change the related listings query - #15](https://community.hivepress.io/t/change-the-related-listings-query/15456/15).

Please let me know if you need further assistance.

---

<div class="post-metadata">

**Author:** ![Arthur](https://community.hivepress.io/letter_avatar_proxy/v4/letter/a/958977/32.png) [@Arthur](https://community.hivepress.io/u/Arthur)\
**Post date:** [September 7, 2026, 9:37pm UTC](https://community.hivepress.io/t/related-similar-listings-algorithm-change/17961/4 "2026-09-07T21:37:32Z")

</div>

Hello ihor,

Thanks a lot for the detailed answer → I was aware of the Related option in the attribute settings, but I didn’t fully understand how it works so far.

Now I get it - it acts as an “AND”, not an “OR” (As I initially believed). Would have been lovely to have an “OR” with variable weights, but for now I can work with it as it is.

Appreciate it!

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [September 8, 2026, 4:36pm UTC](https://community.hivepress.io/t/related-similar-listings-algorithm-change/17961/6 "2026-09-08T16:36:02Z")

</div>

Thanks for your feedback – we’ll consider adding more UI options for the related listings query logic. In the current version, it may still be possible, but with the code customizations (by overriding the `meta_query` via the `hivepress/v1/models/listing/relate` hook).

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [October 8, 2026, 4:36pm UTC](https://community.hivepress.io/t/related-similar-listings-algorithm-change/17961/7 "2026-10-08T16:36:56Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
