2023 California Code › Penal Code - PEN › PART 2 - OF CRIMINAL PROCEDURE › TITLE 12 - OF SPECIAL PROCEEDINGS OF A CRIMINAL NATURE › CHAPTER 1 - Of the Writ of Habeas Corpus › Section 1473.7.

1473.7. (a) A person who is no longer in criminal custody may file a motion to vacate a conviction or sentence for any of the following reasons:
(1) The conviction or sentence is legally invalid due to prejudicial error damaging the moving party’s ability to meaningfully understand, defend against, or knowingly accept the actual or potential adverse immigration consequences of a conviction or sentence. A finding of legal invalidity may, but need not, include a finding of ineffective assistance of counsel.
(2) Newly discovered evidence of actual innocence exists that requires vacation of the conviction or sentence as a matter of law or in the interests of justice.
(3) A conviction or sentence was sought, obtained, or imposed on the basis of race, ethnicity, or national origin in violation of subdivision (a) of Section 745.
(b) (1) Except as provided in paragraph (2), a motion pursuant to paragraph (1) of subdivision (a) shall be deemed timely filed at any time in which the individual filing the motion is no longer in criminal custody.
(2) A motion pursuant to paragraph (1) of subdivision (a) may be deemed untimely filed if it was not filed with reasonable diligence after the later of the following:
(A) The moving party receives a notice to appear in immigration court or other notice from immigration authorities that asserts the conviction or sentence as a basis for removal or the denial of an application for an immigration benefit, lawful status, or naturalization.
(B) Notice that a final removal order has been issued against the moving party, based on the existence of the conviction or sentence that the moving party seeks to vacate.
(c) A motion pursuant to paragraph (2) or (3) of subdivision (a) shall be filed without undue delay from the date the moving party discovered, or could have discovered with the exercise of due diligence, the evidence that provides a basis for relief under this section or Section 745.
(d) All motions shall be entitled to a hearing. Upon the request of the moving party, the court may hold the hearing without the personal presence of the moving party provided that it finds good cause as to why the moving party cannot be present. If the prosecution has no objection to the motion, the court may grant the motion to vacate the conviction or sentence without a hearing.
(e) When ruling on the motion:
(1) The court shall grant the motion to vacate the conviction or sentence if the moving party establishes, by a preponderance of the evidence, the existence of any of the grounds for relief specified in subdivision (a). For a motion made pursuant to paragraph (1) of subdivision (a), the moving party shall also establish that the conviction or sentence being challenged is currently causing or has the potential to cause removal or the denial of an application for an immigration benefit, lawful status, or naturalization.
(2) There is a presumption of legal invalidity for the purposes of paragraph (1) of subdivision (a) if the moving party pleaded guilty or nolo contendere pursuant to a statute that provided that, upon completion of specific requirements, the arrest and conviction shall be deemed never to have occurred, where the moving party complied with these requirements, and where the disposition under the statute has been, or potentially could be, used as a basis for adverse immigration consequences.
(3) If the court grants the motion to vacate a conviction or sentence obtained through a plea of guilty or nolo contendere, the court shall allow the moving party to withdraw the plea.
(4) When ruling on a motion under paragraph (1) of subdivision (a), the only finding that the court is required to make is whether the conviction is legally invalid due to prejudicial error damaging the moving party’s ability to meaningfully understand, defend against, or knowingly accept the actual or potential adverse immigration consequences of a conviction or sentence. When ruling on a motion under paragraph (2) of subdivision (a), the court shall specify the basis for its conclusion.
(f) An order granting or denying the motion is appealable under subdivision (b) of Section 1237 as an order after judgment affecting the substantial rights of a party.
(g) A court may only issue a specific finding of ineffective assistance of counsel as a result of a motion brought under paragraph (1) of subdivision (a) if the attorney found to be ineffective was given timely advance notice of the motion hearing by the moving party or the prosecutor, pursuant to Section 416.90 of the Code of Civil Procedure.
(Amended by Stats. 2021, Ch. 420, Sec. 1. (AB 1259) Effective January 1, 2022.)