At the entrances to trails, we often plan so-called “filter features”. The idea is to design an element at the very beginning that corresponds to the most difficult elements on the entire trail. This way, novices realize right at the beginning that such a trail is not (yet) for them and not only in the middle, when they might not be able to go any further.
If we want to prevent mountain bikes from riding on the trail, we plan elements especially at the beginning of the trail that clearly hinder riding fun – stones that look in the wrong direction, for example. Provided there are alternatives, many mountain bikers then voluntarily refrain from riding such routes.