Return to a situation where it was economically uncomfortable to have bastards.
Problem solves itself.
Would work to cause an impetus to change.