Wandering is a big part of my mum's dementia. 2 years ago she was out the garden gate and around the village, I would often have to get in the car and go look for her. The distance she wandered got shorter - to garden gate open it check bins and back into the house. I have only been able to ease my worry and anxiety by putting a small combination lock on the gate, angry about this at first but she got used to it, at same time I moved all bins from gate so she could not climb over. At same time I put various things around the house that hopefully she would spot and stop for a while to check out/sort and tidy, as a distraction this worked well and still does[sometimes].
Now we are at the stage when she is still wandering, but only to the gate and back, for my part I have had to accept this as she is relatively safe - nothing to trip on out there. Wandering always starts around 1pm and usually goes on all afternoon and into early evening so at 4pm when it is getting dark, I lock the front door, she still wanders around the house and occasionally tries to open front door. The hardest part for me is when she takes a break from this wandering for about 4hrs in evening, then I get her into bed but some nights within an hour she is up and wandering around the house and this can go on for hours and extremely hard to ignore.