Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:22:12

He invokes instead of Allah that which neither harms him nor benefits him. That is what is the extreme error.  

He calls on, he worships, besides God, in the way of idols, that which could not hurt him, should he refrain from worshipping it, and that which could not profit him, if were to worship it. Such, a call, is extreme error, from the truth.
القرآن:٢٢:١٢

يَدْعُو مِنْ دُونِ اللَّهِ مَا لَا يَضُرُّهُ وَمَا لَا يَنْفَعُهُ ۚ ذَٰلِكَ هُوَ الضَّلَالُ الْبَعِيدُ  

{يدعو} يعبد {من دون الله} من الصنم {ما لا يضره} إن لم يعبده {وما لا ينفعه} إن عبده {ذلك} الدعاء {هو الضلال البعيد} عن الحق.