You can keep mold out of your Waterpik by cleaning the Waterpik with some white vinegar or hydrogen peroxide.
As long as you wash out your Waterpik and occasionally use some vinegar or hydrogen peroxide in the Waterpik and it can keep the mold out of the Waterpik.
I do this with my Waterpik and it keeps the mold out of the Waterpik.
To keep your Waterpik clean you can also wash the reservoir out with soapy water or in the top rack of your dishwasher.
And about once every week separate the water reservoir from the Waterpik and wipe it clean with a soft cloth and mild non abrasive cleaner.
As long as you do those things the Waterpik should never develop any mold.