Please explain with some quotations from the salafi ulema.
The ignorance for which a person may be excused is ignorance of the ruling. Whoever does not do an obligatory action because he does not know that it is obligatory, or he does a forbidden action because he does not know that it is forbidden, is an ignorant person who may be excused for his obedience.
But if a person knows that something is forbidden and he does it, but he is ignorant of the punishment for that, he has no excuse, because he has knowingly committed a sin and transgressed the bounds.
If a person commits zina – for example – and does not know that zina is haraam, he will not be punished and is excused for his ignorance. But if a person knows that zina is haraam but he does not know that the one who commits zina deserves the hadd punishment, then he has no excuse and the hadd punishment must be carried out on him, if the conditions for that are met.
Similarly, if a person does not pray and he does not know that prayer is obligatory, he is to be excused for his ignorance and is not regarded as a kaafir. But if a person does not pray and he knows that not praying is haraam but he does not know that not praying is kufr, then he is not to be excused.
There follows some evidence for the above, as well as some comments of the scholars:
(A) If a person is ignorant of the ruling on the forbidden action and does it, and there is some hadd punishment or expiation required for that, it is not required in his case.
The evidence for that is the words of the Prophet (peace and blessings of Allaah be upon him) to a person who confessed that he had committed zina: “Do you know what zina is?” Narrated by Abu Dawood, 4428. This hadeeth was also reported in al-Saheehayn.
Ibn al-Qayyim – who classed the report of Abu Dawood as saheeh – said: The hadd punishment is not due for one who was ignorant of the fact that it is forbidden, because the Prophet (peace and blessings of Allaah be upon him) asked him about the ruling on zina, and he said: I did with her wrongfully haraam what a man does with his wife lawfully.
Zaad al-Ma’aad, 5/33.
(B) If he knows that it is haraam but is ignorant of the consequences, whether a hadd punishment, required expiation or anything else, then the hadd punishment must be carried out on him because he dared to do something haraam, and he must offer the expiation if the sin requires expiation.
The evidence for that is the hadeeh of Maa’iz (may Allaah be pleased with him) who confessed that he had committed zina, in which he said: “O people, take me back to the Messenger of Allaah (peace and blessings of Allaah be upon him), for my people deceived me and killed me.” Narrated by Abu Dawood, 4420; its isnaad was classed as jayyid by al-Albaani (may Allaah have mercy on him) in al-Irwa’, 7/354. This Sahaabi (may Allaah have mercy on him) knew that it was haraam but he was unaware of the punishment.
Ibn al-Qayyim (may Allaah have mercy on him) said: This indicates that ignorance of the punishment does not excuse a person from the punishment if he knew that it is haraam. Maa’iz did not know that the punishment was execution, but this ignorance did not excuse him from the punishment.
Zaad al-Ma’aad, 5/34.
Similarly, the Sahaabi who had intercourse with his wife during the day in Ramadaan did it deliberately and knew that it was haraam. As was pointed out by al-Haafiz ibn Hajar in al-Fath (4/207), this is indicated by the fact that he said “I am doomed” – or according to another report, “I am burned.” The Prophet (peace and blessings of Allaah be upon him) ruled that he had to offer expiation, and did not excuse him because he was unaware of it. This was narrated by al-Bukhaari, 1834; Muslim, 1111.
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) said:
If someone were to say: Wasn’t the man who came to the Messenger (peace and blessings of Allaah be upon him) ignorant?
The answer is: He was ignorant of what was required of him; he was not ignorant of the fact that this was haraam. Hence he said, “I am doomed.” If we say that ignorance is an excuse, we are not referring to ignorance of the consequences of this haraam action, rather we are referring to ignorance of the ruling on this action and whether it is haraam or not. Hence if a person commits zina and is ignorant of the fact that it is haraam, and he does not live in a Muslim country, or he is new in Islam, or he lives in a remote area and does not know that zina is haraam, then no hadd punishment is to be carried out on him. But if he knows that zina is haraam, but he does not know that the hadd punishment for it is stoning, or lashing and banishment, then the hadd punishment should still be carried out on him, because he has transgressed a sacred limit. Ignorance of the consequences of a haraam action is no excuse. Ignorance of whether an action is haraam or not is an excuse.
Al-Sharh al-Mumti’, 6/417
And Allaah knows best.