If that happens, some mothers may have some explaining to do, right there after having their baby.
That might encourage them to refrain from activities that require "explaining".
Oh, yeah ...
Don't marry a proper garden tool.
A good friend used to be a delivery nurse in an inner city hospital. The staff would consult with the expectant mother about paternity because there were regularly fights in the delivery room when the kid came out as clearly not sired by the man the mother claimed was the father.
When the hospital had a likely candidate, they'd have security on standby along with the local cops who were in and out of the hospital all the time.
The delivery room fights usually weren't with the mother but between her family and the intended paternity fraud victim. The victim was so incensed because the mother's family knew the truth and had often been questioned prior but had repeatedly lied to the victim.
Family court is a fraud and a government racket designed to fleece designated victims and the taxpayers. Paternity fraud needs to be treated like the crime that it is.