Worms do not eat fresh onions. When added to the compost heap, worms keep off the onions due to the smell. No need to worry since the odor fades away when the decaying process is complete. Once the onions reach a certain level of decomposition, the worms are ready to eat them. For this reason, slice your onion into smaller pieces for faster decomposition. In conclusion, worms do eat onions, though not when fresh.