This caterpillar is also called a parsley caterpillar or parsley worm because it eats toxins from host plants in the carrot family – carrots, parsnips, parsley, dill, and even Queen Anne’s lace. According to Texas A&M, it’s a bad-tasting caterpillar so birds and predators won’t eat it. They love parsley (hence the name parsley worm). That appears to be their favorite thing to much on.
This larval caterpillar of the Black Swallowtail Butterfly gets its name from its tendency to find refuge in parsley plants. Growing to around two inches in length, this caterpillar with black stripes and yellow dots consumes the leaves of growing plants.
Although parsley worms are considered pests in their caterpillar stage, they are actually beneficial in the long run. The adult butterflies are not only gorgeous, they will also help pollinate your garden flowers. So if you do find parsley worms, seclude them to one or two plants. Share some parsley, receive some butterflies!
You could try a spray of vinegar and soapy water to kill the bugs and keep them away.