You can compost almost any type of plant. Weeds provide a great filler for compost piles because many of them, such as grassy weeds, are high in nitrogen and other beneficial nutrients. However, weeds that have gone to seed are not good additions to a compost pile because those seeds often sprout and then introduce many more weeds to your garden when you use the finished compost. The heat that a compost pile generates will kill or inactivate some weed seeds, but to be on the safe side, choose weeds for your compost pile that have not yet formed seeds. According to the Howard formula for composting weeds, "Some of the very worst weed villains make the very best of compost."
Composting With Weeds
Mow or weed whack grassy weeds such as crabgrass, and then rake and collect the material. Do this before any seeds have formed.
Layer your grassy weeds alternately with layers of dried, brown plant material such as fallen leaves or other plant parts in order to keep your compost oxygenated and prevent an anaerobic situation, which can cause your compost to smell unpleasant.
Pull weeds such as plantain, mallow or spurge by hand and then snip off the roots before you place them in your compost pile. You can include the roots, but if you leave them on there's a chance the entire plant will continue growing in the compost pile.
Include dry plant material between layers of all fresh, green weeds that you add to your compost.
Turn your compost pile every 3 to 4 days with a pitchfork to accelerate the composting process.