As Halloween nears, you might be strategizing how to deal with your child’s annual sack of Halloween candy after a big night of trick-or-treating.

It’s no secret that sugar is bad for teeth. But the effects of poor dental health extend far beyond a treat-heavy holiday.

Dental issues are a leading cause of absence from school, and California ranks right near the bottom among states when it comes to kids’ oral health. However, parents can fend off sugar’s role in dental decay and infections, Venice Family Clinic dental director Dr. Jaspreet Kaur said.

“Halloween is a reminder and a learning opportunity to set boundaries,” she said. “Teach your kids that they can enjoy the treats, but in balance.”

Here are some tips from dentists for keeping your child’s mouth healthy at Halloween and beyond:

Avoid chewy, sticky, hard and sour treats

Candies that are chewy or sticky tend to stay in a child’s mouth longer than others. Soft, taffy-like candy, caramel and gummies get caught between teeth or in their grooves. Hard candies, like lollipops that children suck on, linger longer in the mouth.

When the candy isn’t washed or brushed away quickly it produces acid, which can break down the enamel that protects teeth and causes cavities, according to Dr. Santos Cortez, a pediatric dentist in Long Beach. Sour candies are extra damaging because they not only introduce sugar to the mouth, but also acids when first eaten.

The texture issues don’t just apply to candy either. That packet of raisins in your child’s trick-or-treat bag isn’t necessarily a better option. The sticky texture of the raisins causes the sugar to stick to the teeth in the same way as candy, making the mouth more susceptible to cavities, Cortez said.

Juice and soda are also a problem. Like with hard candies, the sugar may stay on your child’s teeth for a while, especially if they take a long time to drink it, which means the teeth are exposed longer.

Opt instead for sweets like chocolate — dark chocolate if you can. Chocolate, as long as it isn’t mixed with something like caramel, tends to melt in the mouth faster and is easier to brush off.

Bring a water bottle with you on your Halloween route.

Have your child drink water after eating candy. The water can help wash away some of the residue left behind by the sweet treat, according to Cortez. Keep a bottle handy as you trick-or-treat to have your child sip and wash off some of the stickiness as they enjoy the night. That will help reduce sugars until they are able to brush their teeth.

Make a habit of having them drink water any time they consume sugar and can’t brush right away. Instead of bottled water, give them tap water, which should contain fluoride to help stave off dental decay.

Of course, brush their teeth

Make sure your child brushes their teeth as soon as possible after eating candy or anything sweet. If your child is determined to brush on their own, let them, but make sure to get in there afterward to remove plaque. Continue to brush your child’s teeth for them until they are 8 years old, using a pea-sized amount of fluoride toothpaste. Using a fluoride toothpaste helps combats the effects of sugar.

In baby teeth, cavities tend to develop between teeth, so be sure to help you child floss once they’re ready.

If you have a baby whose first tooth is just appearing, brush it with a small smear of fluoride toothpaste on a baby toothbrush twice a day — just enough to color the bristles. For infants without teeth, dentists recommend wiping their gums with a clean cloth after feedings.

Remember, taking care of baby teeth is just as important as taking care of the permanent teeth. Problems that affect the baby teeth now can affect the permanent teeth later on if not addressed.

Set rules on candy

Set rules about how much candy your child can consume — a small amount daily. It’s better to let them eat a piece or two at once rather than allowing them to snack on sugary treats multiple times throughout the day, according to pediatric dentist Dr. Alexander Alcaraz, the program director of pediatric dentistry at USC Ostrow School of Dentistry. Constant and long exposures to sugar feed the bacteria that develop cavities. Saliva also needs time to neutralize the acids in the mouth that can break down the enamel.

Kaur also recommends limiting the time a child sucks on hard candy such as a lollipop. Some kids will suck on candy for up to half an hour. Opt for 10 minutes, for example, she said.

Have them eat candy with a meal

Leave candy — or any sweets for that matter — for an after-meal snack. When kids eat, more saliva is produced, which can better wash away the goodies. It might make it easier to remember to have your kids brush their teeth soon afterward as well, since many parents have kids brush their teeth after a meal.

Some foods also have self-cleaning qualities. Fruits and vegetables like apples, celery and carrot sticks rub into the enamel when you bite into them, removing plaque.

Exchange the candy

Limit how long the candy bag is available so your child does not get used to having it within reach. Remove some of the candy your child collected or trade it all for a toy or extra play time. Check if your dentist or another group is sponsoring a candy donation effort.

You can also take part in a new tradition and invite the “Switch Witch” into your home. Have you child put aside some of their candy for the Switch Witch, who’ll visit overnight to pick up the candy and leave something fun in its place. You can leave a toy for them to find the next morning.

“Cavities don’t happen overnight,” Alcaraz said. “It takes time. It’s not a one-day process.”

Go to the dentist

After the first baby tooth emerges or your child reaches age 1, it’s time to see the dentist, who can add a coat of fluoride varnish to strengthen tooth enamel. Their efforts can make the effect of sugar-filled holidays less stressful.

A dentist will let you know early on, for example, to avoid putting an infant to bed with a bottle of milk or formula because the liquid can sit on their teeth, and the sugars cause cavities, sometimes even before the first tooth emerges.

Developing a relationship with dentists with an appointment every six months will also help keep you better informed as they grow. For young kids, the goal is to set strategies for families to keep the teeth healthy and reduce risk of gum disease and dental decay, Cortez said.

Ask the dentist to apply sealants to a child’s back molars around the age of 6, the Los Angeles County Department of Public Health recommends. The thin coating can protect the chewing surface of the teeth from developing cavities.

“It’s the most common chronic disease in children, more common than asthma,” Cortez said about dental decay, which affects more than 60% of kids in California by third grade. “We need to pay more attention. And so for pediatric dentists anyway, and for all dentistry, I think that the key is to start early.”

This article is part of The Times’ early childhood education initiative, focusing on the learning and development of California children from birth to age 5. For more information about the initiative and its philanthropic funders, go to latimes.com/earlyed.