What can be added to non dairy milks to extend shelf life? I'm not sure what's going on but the last two batches of homemade cashew and sunflower seed milks went bad faster than usual i.e. 1-2 days. 

What can be added to make them last longer? Both artificial and natural preservatives are ok for me.
This question has two facades:


First get rid of the already-there spoilage microorganisms.


Before blending the nuts, I soak them in vinegar for a while and rinse thoroughly. And always using sanitized equipment and boiling the water (and sugar if you're adding) is quite a good practice to kill the microorganisms you might have in your ingredients.


Prevent (or at least postpone) future spoilages.


If you have a sous-vide setup, using the lowest pasteurization temperature at 54C you can try to pasteurize. Please check some charts on this. It's hard to give an estimate without knowing your container sizes.
Some nut-milk can handle acidity, some can't you can experiment with that as well.