Hello mosaik,
Thank you for contacting us about stopping spam referral traffic. You can use a robots.txt file, which can stop some unwanted traffic. Keep in mind this does not stop them from crawling, but requests that they do not crawl.
You can block unwanted traffic using .htaccess rules.
Also, you can Disavow Bad Links from an External Pages using Google or Bing Disavow tools.
Let us know if you have any further questions.
Thank you,
John-Paul