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:9:113

It is not for the Prophet and those who have believed to ask forgiveness for the polytheists, even if they were relatives, after it has become clear to them that they are companions of Hellfire.  

The following was revealed regarding the Prophet (s) asking forgiveness for his uncle Abū Tālib, and some of the Companions asking forgiveness for their idolatrous parents: It is not for the Prophet, and those who believe, to ask forgiveness for the idolaters, even though they be kinsmen, relatives, after it has become clear to them that they are inhabitants of the Hell-fire, for having died as disbelievers.
القرآن:٩:١١٣

مَا كَانَ لِلنَّبِيِّ وَالَّذِينَ آمَنُوا أَنْ يَسْتَغْفِرُوا لِلْمُشْرِكِينَ وَلَوْ كَانُوا أُولِي قُرْبَىٰ مِنْ بَعْدِ مَا تَبَيَّنَ لَهُمْ أَنَّهُمْ أَصْحَابُ الْجَحِيمِ  

ونزل في استغفاره ﷺ لعمه أبي طالب واستغفار بعض الصحابة لأبويه المشركين (ما كان للنبي والذين آمنوا أن يستغفروا للمشركين ولو كانوا أولي قربى) ذوي قرابة (من بعد ما تبين لهم أنهم أصحاب الجحيم) النار، بأن ماتوا على الكفر.