A Muslim is not permitted to seek forgiveness for grandparents who die as Mushriks

Q: I have grandparents who died in Shirk (disbelief); is it permissible to ask Allah's Forgiveness for them?

A: It is impermissible for a Muslim to invoke Allah's Forgiveness for their grandparents or others, if they died in Shirk, for Allah (Exalted be He) says: It is not (proper) for the Prophet and those who believe to ask Allâh’s Forgiveness for the Mushrikûn (polytheists, idolaters, pagans, disbelievers in the Oneness of Allâh), even though they be of kin, after it has become clear to them that they are the dwellers of the Fire (because they died in a state of disbelief). May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.