This divorce action involves the termination of the parental rights of the husband, who was the child’s legal father for 13 years. The husband is appealing the superior court’s order severing his rights as legal father and granting the biological father’s petition to legitimate. Because we conclude that the superior court did not have subject matter jurisdiction to terminate the legal father’s parental rights, we reverse.
Gwendolyn Brine and William Robert Brine were married in August 1997, just weeks after a relationship between Gwendolyn and Brian Shipp ended. When Shipp found out in the spring of 1998 that Gwendolyn was pregnant, he asked her whether he was the father, and she said no. The child was born in May 1998, and Brine was listed on the birth certificate as the father. Approximately 18 months later, Shipp again saw Gwendolyn and asked whether he could be the father. She said that she was married and the child was not his. For the next ten years, Shipp made no more inquiries and took no further action concerning the child’s paternity. He saw the child occasionally as a family friend, but did not attempt to develop a father-son relationship or provide any substantial financial or emotional support. In August 2010, a year after William filed for divorce, Gwendolyn informed Shipp that she thought he was the child’s biological father; subsequent DNA testing confirmed that fact.
In February 2011, Shipp moved to intervene in the divorce action and filed a petition for legitimation. Following a hearing, the superior court found that Shipp had not waived or abandoned his opportunity interest in developing a relationship with the child and that it was in the child’s best interest to grant the legitimation petition. As part of the divorce decree, the superior court terminated William Brine’s rights as the legal father, granted Shipp’s petition to legitimate, and awarded Shipp primary physical custody of the child. William Brine *377filed an application for discretionary appeal, which this Court granted as having possible merit.
1. Because of jurisdictional concerns, we asked the parties to address whether the superior court had subject matter jurisdiction to terminate the parental rights of the legal father in the legitimation proceeding that was brought as part of this divorce action. See OCGA § 15-11-28 (a) (2) (C). Although the parties have not raised any objections to jurisdiction, subject matter jurisdiction cannotbe waived or conferred on a court by agreement. Amerson v. Vandiver, 285 Ga. 49, 50 (673 SE2d 850) (2009); Bolden v. Barton, 278 Ga. 831 (1) (607 SE2d 889) (2005); see OCGA § 15-1-2.
The Georgia Constitution gives superior courts “jurisdiction in all cases, except as otherwise provided in this Constitution.” Ga. Const. Art. VI, Sec. IV, Par. I. Concerning courts of limited jurisdiction, the constitution declares that juvenile courts have “uniform jurisdiction as provided by law.” Ga. Const. Art. VI, Sec. III, Par. I. OCGA § 15-11-28 provides that juvenile courts have exclusive jurisdiction over the termination of parental rights, except in connection with adoption proceedings. The relevant statutory provision states:
(a) Exclusive original jurisdiction. Except as provided in subsection (b) of this Code section, the court shall have exclusive original jurisdiction over juvenile matters and shall be the sole court for initiating action:
(2) Involving any proceedings:
(C) For the termination of the legal parent-child relationship and the rights of the biological father who is not the legal father of the child, other than that in connection with adoption proceedings under Article I of Chapter 8 of Title 19, in which the superior courts shall have concurrent jurisdiction to terminate the legal parent-child relationship and the rights of the biological father who is not the legal father of the child.
The predecessor of this provision was enacted into law in 1971 as part of the new Juvenile Court Code of Georgia. Ga. Laws 1971, pp. 709, 712 (codified at Ga. Code Ann. § 24A-301 (b) (3)).
*3782. Based on this statute, we have previously concluded that the superior court lacks jurisdiction to terminate parental rights in a divorce and child custody case. Cothran v. Cothran, 237 Ga. 487, 488 (228 SE2d 872) (1976). In Cothran, the superior court found both parents were unfit, terminated their parental rights, and awarded custody to the Department of Family and Children Services. Id. at 487; see also Dein v. Mossman, 244 Ga. 866 (1) (262 SE2d 83) (1979) (superior court in a habeas corpus action for child custody lacks authority to find grandparents unfit and terminate their parental rights). More recently, we reaffirmed that a superior court judge did not have subject matter jurisdiction to terminate a father’s parental rights as part of a settlement agreement incorporated into the final divorce decree. Amerson v. Vandiver, 285 Ga. at 50; cf. Taylor v. Taylor, 282 Ga. 113, 113 (1), n. 1 (646 SE2d 238) (2007) (superior court’s order denying any visitation by husband with child is not a termination of parental rights). Similarly, the Court of Appeals has held that the superior court does not have jurisdiction to consider a petition seeking to terminate parental rights that is not filed in connection with adoption proceedings. In the Interest of A. D. B., 232 Ga. App. 697 (503 SE2d 596) (1998); Alexander v. Guthrie, 216 Ga. App. 460 (2) (454 SE2d 805) (1995); Brant v. Bazemore, 159 Ga. App. 659 (284 SE2d 674) (1981); cf. In the Interest of J. S., 302 Ga. App. 342 (4) (691 SE2d 250) (2010) (rejecting biological father’s contention that juvenile court lacked subject matter jurisdiction over termination petition that was not filed in connection with a formal adoption proceeding). The Juvenile Code sets forth the required grounds and procedure for the termination of parental rights. See OCGA § 15-11-94 (in terminating parental rights court must determine there is clear and convincing evidence of parental misconduct or inability).
Quite aside from the controlling constitutional provisions regarding the subject-matter jurisdiction of our courts, there are compelling public policy reasons to keep these child-sensitive issues in the juvenile courts, where the best interests of the child are paramount and protections exist, such as the appointment of guardians ad litem, OCGA § 15-11-98 (a), that serve to guarantee those best interests are considered.
Amerson, 285 Ga. at 51 (Hunstein, P. J., concurring).
In some cases, the superior courts have terminated parental rights outside the adoption context, but the appellate court decisions in those cases do not address the issue of subject matter jurisdiction. See Taylor v. Taylor, 280 Ga. 88 (623 SE2d 477) (2005) (holding superior court failed to determine whether the voluntary agreement *379terminating husband’s parental rights was in the child’s best interest); Baker v. Baker, 276 Ga. 778 (582 SE2d 102) (2003) (holding superior court failed to consider best interests of child when wife rebutted presumption of legitimacy raised by child’s birth during the marriage); Davis v. LaBrec, 274 Ga. 5 (549 SE2d 76) (2001) (holding best interests of the child standard applies to biological father’s petition in superior court to establish paternity, set aside previous legitimation order, and legitimate and obtain custody of child); see also In the Interest of C. L., 284 Ga. App. 674, 676, n. 1 (644 SE2d 530) (2007) (listing cases regarding custody disputes between a biological father and a legal father). When the parties do not raise a question concerning the superior court’s jurisdiction and this Court does not address the issue on appeal, our decision does not stand for the proposition that the superior court had jurisdiction to take the action. See State v. Outen, 289 Ga. 579, 582 (714 SE2d 581) (2011).
3. Whether the superior court had subject matter jurisdiction to sever the legal father’s parental rights in this case depends on whether the issue is considered primarily as one involving legitimation or one involving termination. Compare OCGA § 15-11-28 (a) (2) (C) (juvenile courts have exclusive original jurisdiction over proceedings involving termination except in connection with adoption) with OCGA §19-7-22 (a) (superior courts have jurisdiction over legitimation petitions filfed by father of child born out of wedlock). In making this determination, each petition must be judged on its own merits with the pleadings “construed according to their substance and function and not merely as to their nomenclature.” In re M. C. J., 271 Ga. 546, 548 (523 SE2d 6) (1999) (reversing Court of Appeals’ decision that all deprivation actions brought by one parent against another are custody disputes that must be filed in superior court); see In the Interest of A. R K. L., 314 Ga. App. 847 (726 SE2d 77) (2012) (rejecting father’s argument that juvenile court lacked subject matter jurisdiction on the grounds that termination petition was actually a disguised adoption matter or disguised custody matter); Ghrist v. Fricks, 219 Ga. App. 415 (2) (465 SE2d 501) (1995) (construing petition to terminate parental rights as in substance a petition to determine paternity and to legitimate the child, issues over which superior court had jurisdiction); see also Taylor v. Taylor, 280 Ga. at 90 (Hunstein, P. J., concurring specially) (correctness of trial court’s order terminating husband’s parental rights depends on juvenile code statute outlining grounds for termination, not custody statute).
Looking at the substance of the issue here, rather than its nomenclature, the biological father’s petition to legitimate a child who was born in wedlock is in essence a petition to terminate the parental rights of the legal father. This case started out originally as *380a divorce and child custody dispute between the husband and wife. The focus shifted to the child’s paternity when the biological father intervened in the divorce action. After the trial court determined that the biological father had not abandoned his opportunity interest, the issue became whether the superior court should grant the petition to legitimate the child. Since all children born in wedlock are deemed legitimate by law, the superior court was faced with a situation where the biological father of a child sought to delegitimate the child and sever an existing father-child relationship. See Baker v. Baker, 276 Ga. at 781; Davis v. LaBrec, 274 Ga. at 7. To grant the legitimation petition required the superior court to first terminate the parental rights of the legal father.
Decided July 13, 2012. Angela A. Woodall, for appellant. Talley, Richardson & Cable, William T. Cable, Jr., Jamie G. Averett, Wayne D. Keaton, Scott W. Shaw, for appellee.When, as here, a biological father’s petition to legitimate a child born in wedlock can only be granted by first terminating the legal father’s parental rights, we conclude that the superior court does-not have jurisdiction over the termination decision. See Amerson v. Vandiver, 285 Ga. at 50; see also Alexander v. Guthrie, 216 Ga. App. at 462 (mother’s right to object to petition to legitimate in superior court did not include a right to seek a termination of biological father’s rights in legitimation proceeding). We overrule Division 2 in Ghrist v. Fricks and Division 2 in Matthews v. Dukes, 314 Ga. App. 782 (726 SE2d 95) (2012), to the extent they determined that the superior court had jurisdiction to sever parental rights because the termination issue was ancillary to the biological father’s petition to legitimate.
Judgment reversed.
All the Justices concur.