Answer:
Praise be to Allah, the Lord of the World; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
It is permissible for you to wear a chain Allah's Name is written on it provided there should not be any disrespect to it. Taking it to toilet or exposing it to impurities is considered as disrespecting it. It is narrated from the Prophet (Sallallahu Alaihi wa Sallam) that he used to remove his ring when he went to a toilet since the ring was engraved with Muhammad Rasool-Ullah (Muhammad is the Messenger of Allah). Allah Says (interpretation of meaning):
{…And whosoever honours the Symbols of Allâh, then it is truly from the piety of the heart.} [22:32].
Imam
Ibn Abi Shaibah narrated from
Ikrimah who said that
Ibn Abbas used to give him his ring before entering a toilet and said to him, 'if you are compelled to enter the toilet with it, take hold of the Name of Allah or cover it with a cloth or the like'.
Imam
Ibn Abi Shaibah narrated from
Ikrimah from
Ibn Abbas who said: 'If someone enters a toilet while he is wearing a ring with the Name of Allah, should take it inside of his palm and then hold it with his finger'.
Imam
Ahmad said: 'If a ring or the like contains the Name of Allah, one should take it inside of his palm'.
Allah knows best.