Before you visit a shrine you must research about the person buried in it to make sure he was righteous and that he was on the right path. Do research then based on your research visit those shrines. If the person was not on the right path, you should not visit his shrine.