The term ‘urfi marriage is used by people to refer to two types of marriage:
1. Where the marriage fulfils all the conditions and necessary parts, the most important of which in this case are the agreement of the woman’s guardian and having the marriage witnessed, but it is not documented in the civil courts or it is not publicised among people. This is a valid marriage although it is a mistake not to have it documented, and there is no problem with attributing the child to his father in this kind of marriage.
2. The second type is that to which people usually refer, which is when the woman gets married in secret, without the approval of her guardian. This is an invalid marriage and the partners must be separated.
Shaykh Ibn Baaz (may Allah have mercy on him) was asked: We hear about secret marriage, ‘urfi marriage, mut‘ah marriage and misyaar marriage. What is the shar‘i ruling on these marriages?
He replied: None of these types of marriage are permissible because they are contrary to sharee‘ah. The type of marriage that is permitted in sharee‘ah is that which is announced and which fulfils all the necessary parts of marriage and conditions required by sharee‘ah.
End quote from Majmoo‘ al-Fataawa, 20/428
With regard to the child, he is to be attributed to the father if the partners believed that the marriage was valid, because this comes under the heading of intercourse that took place within a dubious marriage contract. If they believed that it was invalid, then the child is not to be attributed to the man; rather he is to be attributed to his mother because in this case it is regarded as zina (fornication or adultery). Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said: The Muslims are unanimously agreed that any marriage in which the husband believes that it was a proper marriage, if he has intercourse on the basis of this marriage, then the child is to be attributed to him and they may inherit from one another according to Muslim consensus. If a man marries a woman in an invalid marriage concerning which there is consensus that it is invalid or that there is some dispute as to its validity, the child born as a result is to be attributed to him and they may inherit from one another according to Muslim consensus.
End quote from Majmoo‘ al-Fataawa, 34/13.
See also the answer to questions no. 45663 and 45513
And Allah knows best.
Reproduced from Islam QA