Fungus gnats look similar to mosquitoes and are about 1/8 to 1/10 inch long. You may notice them at windows or swarming around your plants. They are attracted to soil that is moist and high in organic material where they can lay their eggs. The larvae of fungus gnats can cause injury to the roots of your hydrangea if the numbers are high enough. If larvae become a problem, you may notice a loss of vigor, poor growth and leaves wilt, turn yellow or drop.
If your hydrangea has become infested with fungus gnats, allowing the soil to dry as much as possible before watering can help kill maggots. Remove any old plant material and debris around the plants. Yellow sticky cards or electrocutor-light fly traps can be placed above your hydrangea to reduce adult fungus gnat populations. Pyrethrin spray or aerosols labeled for "flying insects" can also be used to control adult fungus gnat populations.
Like fungus gnats, shore flies are also attracted to moist, organic material to lay their eggs. The good news is that shore fly larvae feed on algae and won't harm your plants. The bad news is shore flies help spread disease and can leave fecal spots on your leaves. Shore flies are similar in size and color to fungus gnats, but have red eyes, shorter legs and antennae and thicker bodies.
Unlike fungus gnats, shore flies are relatively difficult to control with pesticides. Yellow sticky traps can provide some control, but prevention is much more effective. Avoid overwatering your plants. Use only the minimum amount of fertilizer necessary to avoid fertilizer runoff. Remove any algae growing on mats, walls or structures with an appropriate algaecide.