How to Keep Cats Away from Sandboxes
To keep cats away from sandboxes, try scattering pungent foods around the sandbox, like orange peels, coffee grounds, and vinegar, which will drive the cats away. You can also lay some chicken wire around the perimeter of the sandbox, which cats hate the feeling of walking on. Or, you can get an ultrasonic cat-repellant device and set it up near your sandbox. When cats come nearby, it will emit an unpleasant sound that will scare them away.
Empty out a dirty sandbox to remove existing cat waste. Cats can smell one another's urine, and are often inclined to do their business where other cats have already done theirs. So, if cats have been using your sandbox as a litterbox, dump out all of the sand to remove whatever your cat or neighborhood feral cats have left behind and to discourage the cats from returning. Place the used sand into a garbage bag or trash can. If you aren't able to dump all of the sand out of the sandbox, go through the sandbox with a litter scoop and throw out any feces or urine that you find. Sanitize the sandbox and refill it with clean sand. If you pour a fresh batch of sand into the box without cleaning it, cats will be able to smell the traces of urine and may start using the sandbox as a litter box again. So, fill a bowl with warm water and a few drops of dishwashing soap. Use an old sponge to wipe down the sides and bottom of the sandbox. Then add fresh, clean sand into the sandbox. Deposit enough sand so that the sandbox is roughly 3/4 full. If you don't have replacement sand already on hand, purchase some from a local hardware store or landscape-supply company. Use the plastic lid that came with your sandbox if you have one. This is one of the simplest ways to keep cats out! If your sandbox is relatively small and came with a plastic lid when your purchased it, snap the lid over the sandbox at night and during times when you (or your children) aren't using the sandbox. Only open the lid during the day while you or your children are using the sandbox. Keep the box sealed at all other times. Cover a larger sandbox with a heavy plastic tarp. If your sandbox is larger than 5 by 5 feet (1.5 m × 1.5 m) or if it didn't come with a plastic cover, cover it up with a tarp. Use a tarp that's at least 12 inches (30 cm) larger than the sandbox in length and width. If it's windy out, use 4–8 rocks to weigh down the edges and corners of the tarp so it doesn't blow off or let precipitation into the sandbox. If you don't already have a plastic tarp, purchase one at a local hardware store or an outdoor-supply store. Create a custom sandbox cover with PVC pipe and stiff hardware cloth. Measure the dimensions of your sandbox and cut 4 lengths of PVC pipe. Each segment of pipe should be 8 inches (20 cm) longer than the corresponding side of the box. Staple sheets of hardware cloth from 1 side of the PVC frame to the other. This will hold the frame together. Set the PVC frame over your sandbox to prevent cats from wandering in to it. If you'd like to make the cover more durable and waterproof, staple a large sheet of canvas across the top of the cover. Purchase PVC pipe and all of the other supplies you'll need for this project at a local hardware store. Keep your own cat(s) indoors as much as possible. If 1 or more cats that you own are using your sandbox as a litter box, the simplest solution is to keep the pets inside. They won't have access to the sandbox, and will be safer inside than out since they won't be vulnerable to attacks from other cats, local dogs, and wild animals. If you keep your cats indoors, you'll also prevent them from killing off native birds, squirrels, and other small animals. Lay chicken wire flat around the sandbox to keep wandering cats away. Depending on the size of your sandbox, purchase between 6–20 feet (1.8–6.1 m) of chicken wire. Lay it horizontally around the edges of the sandbox so that the bottom of the wire butts up against the edge of the box. Cats dislike the feeling of walking on chicken wire, and so should avoid your sandbox. Cover the exposed sharp edges and corners of the chicken wire with sand or soil so that children (and cats) don't cut themselves on the metal. Create a cat-friendly zone near the sandbox. In order to deter cats from spending time in your sandbox, try creating an area 10–12 feet (3.0–3.7 m) away from the sandbox that they'll enjoy spending time in. Scatter 5–7 handfuls of cat litter over a 3 ft × 3 ft (0.91 m × 0.91 m) patch of ground, and mix in 4–5 handfuls of dirt. Once cats discover the area, they should do their business there instead of in your sandbox. If the cats aren't interested in the area at first, sprinkle a handful of catnip in the area. This will almost certainly draw their attention! Set up an ultrasonic cat-repellant device near your sandbox. Cats can hear ranges of sound that humans cannot. A motion-activated ultrasonic device will emit an unpleasant sound when a cat approaches and scare off the animal. Most ultrasonic devices are roughly 3 by 3 inches (7.6 cm × 7.6 cm) and either stick in the ground or attach to the wall of a building. Locate the device 5–7 feet (1.5–2.1 m) away from your sandbox. Follow the directions on the packaging, and install the device as directed. Purchase an ultrasonic device at a large pet-supply store or a home-improvement store. Install a motion-activated water sprinkler near the sandbox. Cats typically dislike water, so putting a sprinkler near the sandbox should keep the cats away! You don't need to install an entire system; a single head will suffice as long as it's pointed towards the sandbox. Situate the motion-activated sprinkler head about 6–10 feet (1.8–3.0 m) away from the sandbox and set the angle to sweep roughly 20°, or whatever's needed to spray water across the entire box. Be sure to turn the sprinkler off before you and your children play in the sandbox! Spray an animal-safe commercial repellent weekly around the sandbox. A variety of repellents exist that have been designed to deter cats. Once a week, spray a repellent around the perimeter of the sandbox to keep cats away. Since rain will wash the repellent away, make sure to reapply as soon as a rainstorm has ended. Purchase non-toxic cat repellents at a local pet-supply shop. If your children will be playing in the sandbox, read the label to make sure it's not harmful to humans. Deposit foods that cats hate in and around the sandbox. Several common household foods put off pungent smells that cats dislike. By liberally scattering these foods inside and around the sandbox, you'll discourage cats from using it as a litter box. Orange peels, coffee grounds, vinegar, cayenne pepper, and lavender and eucalyptus oils will drive cats away! Mix any blend of these food items together and sprinkle them around the sandbox area. Since the food aroma will dissipate after 3–4 days, re-apply the foods at least twice a week. 
Empty out a dirty sandbox to remove existing cat waste. Sanitize the sandbox and refill it with clean sand. Use the plastic lid that came with your sandbox if you have one. Cover a larger sandbox with a heavy plastic tarp. Create a custom sandbox cover with PVC pipe and stiff hardware cloth. Keep your own cat(s) indoors as much as possible. Lay chicken wire flat around the sandbox to keep wandering cats away. Create a cat-friendly zone near the sandbox. Set up an ultrasonic cat-repellant device near your sandbox. Install a motion-activated water sprinkler near the sandbox. Spray an animal-safe commercial repellent weekly around the sandbox. Deposit foods that cats hate in and around the sandbox. 