
171 Cal.App.4th 540 (2009)
WILLIAM D. SCOTT, JR., Petitioner,
v.
THE SUPERIOR COURT OF SACRAMENTO COUNTY, Respondent;
RACHAEL A. CHILDRESS et al., Real Parties in Interest.
No. C059686.
Court of Appeals of California, Third District.
February 25, 2009.
*542 Teresa A. Stanley for Petitioner.
No appearance for Respondent.
Downey Brand, John P. O'Malley and J. Michelle Hahn for Real Party in Interest Jan Forsberg.

OPINION
SCOTLAND, P. J.
Jan Forsberg had an intimate relationship with William D. Scott, Jr., and, for many years, she lived with him and his three children from his prior relationship with Rachael A. Childress. (For simplicity and clarity, we will refer to them by their first names and use Bill for William, as the parties have in their briefing.) When Bill's relationship with Jan deteriorated in 2008, Bill and his children moved out of Jan's home.
Seven years prior to his breakup with Jan, Bill had been awarded sole legal and physical custody of his three children in a Uniform Parentage Act (UPA) action between Bill and Rachael. (Fam. Code, § 7600 et seq.; further section references are to the Family Code unless otherwise specified.)
After Bill left with the children, Jan sought to join the dormant UPA action on the ground that she was entitled to custody and visitation as the children's presumed or de facto mother.
Over the objections of Bill and Rachael, the superior court granted Jan's petition for joinder and ordered the parties to mediate the matter of custody and visitation.
Bill then filed in this court a petition for writ of mandate, seeking to overturn the superior court's rulings. He contends that Jan does not have standing to intrude into the parental role of Bill and Rachael and to "diminish [their] rights to make decisions in the best interests of their children." After staying the orders, we issued an alternative writ of mandate to decide the issues raised in Bill's petition. We now conclude the superior court erred.
While we recognize the caregiving role that Jan played in the lives of the children for many years, we conclude she lacked standing to be joined in the UPA proceeding. As we will explain, Jan, a nonparent, cannot seek to gain *543 custody of the children by injecting herself into the inactive UPA action in which the issue of custody was settled years ago.

FACTS AND PROCEDURAL BACKGROUND
Rachael gave birth to her three children with Bill in 1997, 1998, and 1999. In 2000, Bill began dating Jan and moved into her home in December of that year. The children lived with Rachael until Child Protective Services in Nevada removed them from their drug-addicted mother's custody. Bill flew to Nevada to retrieve the children and was awarded sole legal and physical custody in a UPA judgment entered in October 2001 in the Superior Court of Sacramento County.
According to Jan, Bill and his children moved into her home in March 2001 when Bill's mother indicated Bill's stepfather could not tolerate the children's crying and asked them to move. Seven years later, in February 2008, Jan confronted Bill about his alleged infidelity. When she asked him to leave, he "abruptly took the three children . . . and moved in with his mother and step-father."
When Bill refused Jan access to the children, she moved to join the UPA action and to obtain custody under section 3041, subdivision (c)which allows a nonparent to be awarded custody under certain circumstancesand section 3021, subdivision (f)  which makes section 3041, subdivision (c) applicable to UPA custody proceedings. Jan argued joinder was appropriate under California Rules of Court, rule 5.158(a), which states: "The court must order joined as a party to the proceeding any person the court discovers has physical custody or claims custody or visitation rights with respect to any minor child of the marriage." (Further rule references are to the California Rules of Court.)
In Jan's view, she was entitled to custody and visitation as the children's presumed or de facto mother, and she and Bill "must find a way to co-parent our children." Jan stated she held the children out as her own, added them to her health insurance policy at work, was their emergency contact for school and daycare providers, helped with their homework, and integrated them into her extended family. Jan also asserted she was the primary caregiver because Bill was a full-time student and had jobs requiring him to work in the evening or on weekends. Jan submitted numerous photographs and cards demonstrating that the children viewed her as their mother, and that her family viewed the children as part of their family. Jan was concerned about the living conditions at the home of Bill's mother and stepfather, in light of *544 the lack of adequate room and Bill's contentious history with his stepfather. According to Jan, "[t]he children were, and are, my life"; only she, not Bill, is capable of caring for them; and Bill is ignoring the basic public policy that children have continuing and frequent contact with both parents by denying her visitation. She requested mediation of custody and visitation issues.
Bill and Rachael submitted declarations objecting to Jan's joinder and attempt to interfere with their custodial and parental rights. Bill disputed Jan's claims concerning the extent of her parental involvement, and asserted that he was the one who cared for his children, set boundaries for them, put them to bed, and picked them up from school unless his own school or work schedule interfered with his ability to transport them. Among other things, the declarations accused Jan of hitting Bill in the children's presence and of not always acting in their best interests.
The superior court joined Jan as a party in the UPA action under section 3041, subdivision (c), and ordered mediation of issues concerning custody and visitation.

DISCUSSION
Bill contends that Jan lacks standing to be joined as a party in the UPA action because, under the circumstances of this case, she cannot be the children's presumed mother; thus, she is not an interested party and cannot be permitted to interfere with Bill's and Rachael's constitutionally protected right to make custody and visitation decisions for their children. We agree for reasons that follow.
(1) "Jurisdiction to adjudicate custody and visitation in a proceeding under the [UPA] is premised on there being a parent and child relationship [citations]. Thus, parentage in favor of the party seeking custody/visitation must be established." (Hogoboom & King, Cal. Practice Guide: Family Law (The Rutter Group 2008) ¶ 7:23, pp. 7-8 to 7-9; see §§ 7604, 7635, 7637.) In a UPA action, the only interested parties are the children and the natural or presumed mothers and fathers. (§ 7635; Elisa B. v. Superior Court (2005) 37 Cal.4th 108, 126 [33 Cal.Rptr.3d 46, 117 P.3d 660] (hereafter Elisa B).) There can be only two parents, not three. (Elisa B., supra, 37 Cal.4th at pp. 118-119; Amy G. v. M.W. (2006) 142 Cal.App.4th 1, 16-17 [47 Cal.Rptr.3d 297].) In a same sex domestic partner relationship, a child may have two natural mothers (i.e., a biological mother and a mother meeting the presumed parent criteria in section 7611); but in a heterosexual relationship, *545 there can be only one mother. (Elisa B., supra, 37 Cal.4th at pp. 118-119; Amy G. v. M.W., supra, 142 Cal.App.4th at pp. 16-17 [in the undisputed biological mother's UPA petition against the father to establish the mother's parental relationship, the father's wife, who was the child's stepmother, was not an interested party].)
The UPA judgment adjudicated Bill as the children's father. Rachael is the children's natural biological mother; the UPA judgment names her as their mother, and there is nothing in the record indicating her parental rights were terminated or there is an action pending to terminate her parental rights.[1] Accordingly, Jan cannot be the children's presumed mother under sections 7611 and 7650, subdivision (a), and she is not an interested party who can initiate a UPA proceeding concerning the children.
Jan concedes she is not the children's presumed or de facto mother. She also concedes joinder was not mandatory under rule 5.158(a) because the children are not children "of the marriage" (she asserts her reference to this portion of the rule was simply a clerical error).
Nevertheless, according to Jan, joinder is appropriate under the permissive joinder provisions of rule 5.158(b), which state: "The court may order that a person be joined as a party to the proceeding if the court finds that it would be appropriate to determine the particular issue in the proceeding and that the person to be joined as a party is either indispensable to a determination of that issue or necessary to the enforcement of any judgment rendered on that issue. [¶] In determining whether it is appropriate to determine the particular issue in the proceeding, the court must consider its effect upon the proceeding, including: [¶] (1) Whether the determination of that issue will unduly delay the disposition of the proceeding; [¶] (2) Whether other parties would need to be joined to render an effective judgment between the parties; [¶] (3) Whether the determination of that issue will confuse other issues in the proceeding; and [¶] (4) Whether the joinder of a party to determine the particular issue will complicate, delay, or otherwise interfere with the effective disposition of the proceeding."
Jan theorizes that joinder in the UPA action to address issues of visitation and custody is appropriate for the following reasons:
Custody provisions of the Family Code apply to UPA proceedings pursuant to section 3021, the pertinent portion of which states: "This part applies in *546 any of the following: [¶] . . . [¶] (f) A proceeding to determine physical or legal custody or visitation in an action pursuant to the Uniform Parentage Act (Part 3 (commencing with Section 7600) of Division 12)."
Although there is a preference for giving parents the custody of their children (§ 3040, subd. (a)(1)), there are circumstances where parental custody might not be appropriate, in which case custody may be given to nonparents in "whose home the child has been living in a wholesome and stable environment." (§ 3040, subd. (a)(2).)
In Jan's view, custody should be granted to her pursuant to section 3041, which states in pertinent part: "(a) Before making an order granting custody to a person or persons other than a parent, over the objection of a parent, the court shall make a finding that granting custody to a parent would be detrimental to the child and that granting custody to the nonparent is required to serve the best interest of the child. Allegations that parental custody would be detrimental to the child, other than a statement of that ultimate fact, shall not appear in the pleadings. . . . [¶] . . . [¶] (c) As used in this section, `detriment to the child' includes the harm of removal from a stable placement of a child with a person who has assumed, on a day-to-day basis, the role of his or her parent, fulfilling both the child's physical needs and the child's psychological needs for care and affection, and who has assumed that role for a substantial period of time. A finding of detriment does not require any finding of unfitness of the parents."
Jan contends that she pleaded the necessary allegations of detriment by alleging the children were removed from the stable environment she provided in her role akin to a parent; thus, she is entitled to mediate custody and to have a hearing on her claims.
The contention fails because, under the circumstances of this case, joinder is not appropriate, permissively or otherwise.
(2) "The custody provisions of the Family Code apply only in proceedings that are generally, if not invariably, initiated by the parents of a child. Further, they have been held not to provide an independent basis for subject matter jurisdiction. [Citation.] A nonparent seeking custody therefore lacks standing to initiate a custody proceeding under the Family Code. A guardianship petition under the Probate Code is the only judicial means for a nonparent to obtain custody when the parents have not themselves initiated a custody proceeding." (Erika K. v. Brett D. (2008) 161 Cal.App.4th 1259, 1269 [75 Cal.Rptr.3d 152]; see also Polin v. Cosio (1993) 16 Cal.App.4th 1451, 1457, fn. 5 [20 Cal.Rptr.2d 714].)
*547 Jan did not file a petition for guardianship. Thus, for the custody provisions of the Family Code to have any application, they must be pertinent to an issue under consideration in an action initiated by Bill or Rachael. As relevant here, there must be "[a] proceeding to determine physical or legal custody or visitation in an action pursuant to the Uniform Parentage Act . . . ." (§ 3021, subd. (f).)
There is no such proceeding here. In 2001, the superior court entered a UPA judgment establishing paternity and maternity in Bill and Rachael, respectively, and granting full legal and physical custody of the children to Bill. Although the superior court has continuing jurisdiction to modify or set aside a judgment made under the UPA (§ 7642), there is nothing in the appellate record indicating Bill or Rachael are seeking to modify or set aside the judgment concerning their child custody arrangement. Indeed, Jan acknowledges "there are no other matters currently before the court in the [UPA] action . . . ."
This is not a situation where (1) a parent voluntarily left his or her children with a nonparent; (2) the parent subsequently brought an action under the UPA to recover custody of the children; and (3) the nonparent claimed it would be detrimental to remove the children from a stable home environment. (See Erika K. v. Brett D., supra, 161 Cal.App.4th at pp. 1266-1269 [construing mother's petition to recover her child and obtain exclusive custody as the initiation of an action under the UPA, and holding that nonparent could join the action and seek to retain custody without filing a petition for guardianship].) Bill and his children lived with Jan until he ended his relationship with her, at which time he and his family left Jan's residence. He did not initiate, and did not need to initiate, a UPA proceeding to establish his parentage and right to custody.
(3) In sum, Bill and Rachael, the parents of the three children, did not seek to modify the existing child custody arrangement, i.e., the interested parties to their UPA action have not initiated a "proceeding to determine physical or legal custody or visitation" (§ 3021, subd. (f)). Rather, Jan, a nonparent, seeks to gain custody of the children by injecting herself into the inactive UPA action in which the issue of custody was settled years ago. In other words, Jan is attempting to reopen the parents' long-settled custody issue and then claim she is an indispensable party to that issue, which was nonexistent until she sought to interject it into the dormant UPA action. This she cannot do.


*548 DISPOSITION
The petition for writ of mandate is granted. Let a peremptory writ of mandate issue, directing the superior court to (1) vacate its orders joining Jan in the UPA action and compelling the parties to mediate custody and visitation, and (2) issue a new order denying Jan's request for relief. Having served their purposes, the stay is vacated and the alternative writ is discharged.
Nicholson, J., and Cantil-Sakauye, J., concurred.
NOTES
[1]  Information submitted to the mediator indicates that Rachael is attempting to overcome her addiction and to reestablish her relationship with her children.
