Have you thought about using safety gates?
At the moment I don't have a dog (he died 6 months ago) but I have 2 cats and 1.5 year old boy who can't resist eating catfood

I installed these gates on every door to keep him and the cats both safe. When the cats get tired of him they just jump over the gate.