Yes there is a way - It's called "robots.txt". Shows bots what they are and are not allowed to crawl.
An example of a robots.txt file contents, that blocks bots from everything on a site
# go away
User-agent: *
Disallow: /
"Did you know urine is sterile? That's right, you can drink it."