If the website is public, there is no way to stop them . Because there will always be workarounds.
It is up to the operator of the website to protect the areas that should not be generally accessible. I would work with the user rights & groups for Discourse. However, this requires a well thought-out site structure.
You can also block the IP address of unwanted visitors. But no matter what you intend to do, it will only be a emergency solution.
If you don’t want to share your knowledge, you only have three options:
- closed community / by invitation only
- take legal action against the person(s).
- offer paid content and block areas.