The parallel teaching in Matthew 7 is instructive:
20 Wherefore by their fruits ye shall know them.
21 Not every one that saith unto me, Lord, Lord, shall enter into the
kingdom of heaven; but he that doeth the will of my Father which is in
heaven.
This certainly does not rule out the importance of words, as noted in the OP, but it looks like works remain decidedly in scope as well.
Jesus does point out that words & works give evidence of what is in the heart, and as in Mark 7:20-23, that the "heart" or what we might call today the "innermost intentions and priorities" is what defines a person's trajectory.
God looks upon the heart and cares very much about what is there (see 1 Samuel 16:7); we cannot see what is in the heart, but words & works can help us discern true teachers from false ones.
Conclusion
Words and works are both "fruit".
Fruit is what a plant produces, and because fruit bears seeds, fruit determines what a plant leaves behind long after it is gone.
In this sense, "fruit" encompasses words & works specifically, as noted in these verses, but also effects more generally. One's fruit is the effects one leaves behind.
I think Jesus' point is much more general than "discern Bible teachers by studying their teaching and see if the Bible confirms them":
- The Bible did not exist at this time
- The Bible is nowhere mentioned in these verses
- Intense theological disagreement today demonstrates that it is possible to draw differing interpretations of Biblical passages. Not saying that's a good thing, just pointing out that it's a real thing.
Jesus is speaking about truth, which includes but is not limited to truths recorded in scripture.