Since many farm chemicals in use today have not been tested for their effects on earthworm's populations, all inputs should be used cautiously. The way a pesticide is applied may also have an effect. For example, a study showed that anecic species were most susceptible to surface applications of benomyl, and were less affected when the chemical was mixed into the soil. This is because they do not move beyond their permanent burrows, and therefore do not come into contact with subsurface soil beyond their burrows. However, endogeic species which constantly extend their burrows were most affected when the chemical was mixed into the soil.
Sunlight is toxic and even lethal to earthworms.
That is one reason why earthworms wiggle and squirm when dug out of the ground they have an instant response to light exposure designed to get them back below ground as quickly as possible. Some of the paler, deep dwelling species have no defense against sunlight and quickly die when exposed. To encourage earthworms, keep the ground covered with organic matter year-round if possible. Mulches and perennial cover crops are particularly valuable. Not only will mulch keep them cool, but it provides food as well both from the organic material itself and from the fungi, bacteria and other small creatures it supports.