What exactly are you trying to hide? Single posts, threads? Whole forums?
Once something is already indexed and cached, it stays in searches for quite awhile after you hide it.
You can use a 'robots.txt' file to tell the search engine bots not to index, but only the legitimate bots will pay any attention to it.
If you want to outright ban spiders, the code you're using won't do it. There's a mod for that too.
Ban Spiders by User Agent.