We removed our shoes and put on (uncomfortably too small) slippers before climbing to the top of the Himeji Castle -- and this shrine was on the top floor. Then we had to climb all the way back down again and put on our shoes before exiting.