It is said that Kanda Myojin Shrine was relocated by the Shogunate to the current location of kimon (the northeastern [unlucky] direction, person or thing to be avoided) at Edo-jo Castle.
なお、神田明神は幕府によって江戸城の鬼門にあたる現在地に遷座されたと言われる。