Sadly, it is not possible to completely protect clothes against fresh walnut stains. Luckily, some methods can tackle these stains.
The first method is to rinse your clothes in cold water. Add 2-3 teaspoons of dishwashing liquid on the stains followed by 4 drops of vinegar. Rub thoroughly the stained area. Once you have cleaned the area thoroughly, place a paper towel on the stain and wait for 5-10 minutes.
As the last step, rinse the stained area properly, preferably under running water until the stains are completely gone.
Hydrogen peroxide can also be used. Simply dampen the site of the stain and wait for a while. Make sure that the fabric will not be damaged. Detergents that contain bleaching agents can also be used on fresh walnut stains. Combine a teaspoon of bleach agent with one spoonful of water and apply it on the site of the stain. Wipe the site with a clean cloth that has been soaked in water that contains vinegar. Rinse thoroughly with running water.