My 6-year-old sneaks candy and hides the evidence. We've talked to her about not sneaking, and about making healthier food choices. We tried hiding treats and removing them altogether. That backfired and we caught her stealing cough drops to eat, which is dangerous. I don't know what to do. She eats good meals and has frequent snacks (apples, yogurt, cheese), so she isn't taking candy because she is hungry. And if we give her a treat, she still sneaks more later.
First of all, let me say that spanking and frightening a child, in my opinion, are not the best tools to use to reduce any unwanted behavior. These tactics may look very effective in the short term, but over the long haul they will cause you more problems that will very likely show up later in other, even more serious, forms.
I cannot tell from your information what is motivating your child beyond that she likes candy and wants to eat it.
However, here are some suggestions based on my speculations and on solid behavioral psychology.
First, on a simple level: if you don't mind doing it again, and if you and the other family members can live without it, get the candy and the cough drops out of the house. If you all really want the candy, at least get rid of the dangerous stuff.
If you must have it, do not hide it. That sets up the sneaking. Put the candy in the "candy drawer/cabinet/"spot" and set consistent limits on the amount of candy your daughter can have.
If she goes over the limits, have a reasonable consequence. Never withhold basics, food/love/shelter. Be consistent with the limits. Be sure you can back them up and follow through with them.
The bottom line with something like this is to go for safety first. Then do not over react or minimize the issue. See if you can get a reasonable handle on what is going on.
Consider the potential seriousness of this problem. If you get the candy and cough drops out, and she starts going for something else, then the issue may not be about having enough treats or just liking to eat candy.
Are there other behaviors that might indicate an emotional issue?
Is your daughter expressing anything that might cue you to an underlying problem?
Pay attention to other behaviors and talk to her. You may find that the candy stealing is a way of drawing attention to herself. Certainly it is an attention getter.
Might you give her special attention when she complies with the candy limits?
Attention applied for positive behaviors will be more effective than consequence for unwanted behaviors. But be put on notice--any attention, positive or negative, reinforces the behavior, positive or negative.
If you come to the conclusion that this is a deeper matter, and that something is troubling her, you may want to consider counseling. On a simple level, this is behavior that is inappropriate and must be curbed by setting consistent and backed up limits. On a more complex level this may indicate an emotional issue.
You will have to assess that. It is great you are noticing the behavior and are wanting to deal with it for your daughter's physical and emotional well being.