A solenoid valve for irrigation systems may comprise a gardening tube, a plastic valve piece, a cover and a magnetic member. The gardening tube has a water inlet channel and a water outlet channel which are communicated, and a valve tube vertically extending from the gardening tube has a valve chamber. The valve piece is positioned in the valve chamber. A second connecting tube vertically protruding from the cover has a housing communicated with the valve chamber, and a solenoid coil and a metal ring are respectively disposed on the second connecting tube. The magnetic member has a magnet installed therein, and the magnet has a first magnetic surface and a second magnetic surface at two ends thereof.