I have a set of entries which each have 0 or more tags (no limit). For each entry, I am aiming to display 3 'related entries', related by the tags field.

e.g. If entry 1 is tagged with 'apples', 'bananas' and 'pears', then the first results returned would be entries with all 3 tags, followed by 2, followed by just one, then those with none of the tags.

Is this possible? I can't see anything in the documentation about ordering by relevance of the 'relatedTo' parameter.

2 Answers 2


I would consider using Search because it already orders by relevance. You could define the search query using the tags. Make sense?

  • When this question was asked I don't think the score parameter was available, but this has been the option we have been using since that Craft update!
    – Mike Vaux
    Commented Jun 28, 2016 at 14:39
  • Nice Mike! Glad you have a solution.
    – Matt P
    Commented Jun 28, 2016 at 14:40

I've made a plugin called Similar that does exactly this. Give it a go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.