The leaves and roots of most weeds can be composted, except:
Don’t compost weed seed heads, since many seeds will survive temperatures up to 140° F.
Don’t compost roots or runners of weeds that can resprout, such as morning glory (“bind weed”), quack grass, buttercup, and ivy. Either dry them on the driveway or rot inside a black plastic bag until they’re dead (then compost them) or put them in the yard waste collection.