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:6:108

And do not insult those they invoke other than Allah, lest they insult Allah in enmity without knowledge. Thus We have made pleasing to every community their deeds. Then to their Lord is their return, and He will inform them about what they used to do.  

Do not revile those whom they call upon, besides God, namely, the idols, lest they then revile God out of spite, out of aggression and wrongfully, through ignorance, that is, through their ignorance of God. So, in the same way that We have adorned for these that which they practise, We have adorned for every community their, good and evil, deeds, and they commit them; then to their Lord they shall return, in the Hereafter, and He will tell them what they used to do, and requite them for it.
القرآن:٦:١٠٨

وَلَا تَسُبُّوا الَّذِينَ يَدْعُونَ مِنْ دُونِ اللَّهِ فَيَسُبُّوا اللَّهَ عَدْوًا بِغَيْرِ عِلْمٍ ۗ كَذَٰلِكَ زَيَّنَّا لِكُلِّ أُمَّةٍ عَمَلَهُمْ ثُمَّ إِلَىٰ رَبِّهِمْ مَرْجِعُهُمْ فَيُنَبِّئُهُمْ بِمَا كَانُوا يَعْمَلُونَ  

{ولا تسبوا الذين يدعونـ} ـهم {من دون الله} أي الأصنام {فيسبوا الله عدْوا} اعتداء وظلما {بغير علم} أي جهلا منهم بالله {كذلك} كما زيَّنا لهؤلاء ما هم عليه {زيَّنا لكل أمة عملهم} من الخير والشر فأتوه {ثم إلى ربهم مرجعهم} في الآخرة {فينبِّئهم بما كانوا يعلمون} فيجازيهم به.