Maggots can commonly be found in compost bins that use worms to break down the bedding. These maggots are often 1/2-inch long with a grayish brown color. The maggots will the result in soldier flies, which can lay more eggs within the compost. The maggots are harmless to the bin itself, but can also be unpleasant to look at. Once you've fully removed the maggots it's important to manage your compost bin to stop any other unwanted pests from entering.
Wait for two to three days to see if the maggots simply die off if there is not a very large infestation. Also, add more bedding during this time to help kill of the maggots.
Add lime juice or bread that has been soaked in milk to the surface of your compost if the maggot problem continues. The lime juice and bread will attract the maggots.
Wait another two to three days and then remove the bread, which should be infested with maggots. Make sure to wear rubber gloves when removing the bread so that your skin doesn't come in contact with the maggots.
Empty your bin if the infestation of maggots continues and then rinse off all of your worms. Lay your worms on a wire screen to dry off.
Start your compost over again with fresh organic material and bedding. Add your worms in last. Consider keeping your compost bin in another area or using a lid to prevent the appearance of maggots again.