Question: What is the ruling on Zinaa (sexual intercourse outside marriage) in Ramadaan? A man committed this sin when he was ignorant and he asks Allaah (Exalted be He) for forgiveness. It is noted that he is now married and has children. He asked about that and he was told that he has to fast two successive months. But, if he does so, his wife and family will ask why, which will surely cause damage to his character in front of his family, and Allaah (Exalted be He) has veiled him. Thus, is it permissible for him to feed the poor or to free a Muslim slave in order to preserve his dignity and protect his family, which may be disunited because of the mistake he committed before marriage?
Answer: It is obligatory on the man in question to repent to Allaah (Exalted be He) and observe the Kaffarah (expiation) which is to free a Muslim slave; and if this is not possible, then he should fast two consecutive months. If he cannot do that, he should feed sixty poor people… read more here.