Can You Withdraw a Guilty Plea in California? Penal Code 1018 Explained
The short answer: sometimes. California law allows a defendant to withdraw a guilty or no contest plea under Penal Code section 1018 if the motion is made before judgment, or within six months after probation is granted with imposition of sentence suspended, and the defendant shows good cause by clear and convincing evidence. Good cause means something that overcame the defendant's free judgment at the time of the plea, such as mistake, ignorance of a direct consequence, inadvertence, or pressure from counsel, and not simply a change of heart after seeing the sentence. After that window closes, the main routes are a motion to vacate under Penal Code section 1473.7 for people who were not properly advised of immigration consequences, a statutory motion under Penal Code section 1016.5, and a petition for writ of habeas corpus for ineffective assistance of counsel. Every one of these motions is harder than refusing a bad deal in the first place, and the standards are strict. This guide explains each path, the evidence judges in Riverside, San Bernardino, Victorville, and Los Angeles expect to see, and what actually happens if the plea is withdrawn.
Penal Code 1018: Withdrawing a Plea Before Sentencing
The statute. Penal Code section 1018 provides that on application of the defendant at any time before judgment, or within six months after an order granting probation if entry of judgment is suspended, the court may, for good cause shown, permit a plea of guilty to be withdrawn and a plea of not guilty substituted. The statute also provides that a defendant who entered the plea without counsel must be allowed to withdraw it if they later ask to do so with counsel, and it directs that the section be liberally construed to promote justice. No contest pleas entered under Penal Code section 1016 are treated the same way, as explained in what a no contest plea means in California.
The timing window. The phrase before judgment is the key. In a criminal case, judgment is the pronouncement of sentence. A person who pleads guilty in the Riverside Hall of Justice on a Monday and is set for sentencing in six weeks is squarely within the window during those six weeks. A person who is placed on probation with imposition of sentence suspended, which is the common structure for felony probation and many misdemeanors, has six months from the probation order. A person who was sentenced to jail or prison, or whose probation order imposed and then suspended execution of a specific sentence, is generally outside section 1018 once sentence is pronounced and must look to the post-judgment remedies discussed below. The distinction between suspending imposition and suspending execution of sentence is technical and often decides whether a 1018 motion is even available, so the minute order and the plea form should be reviewed by counsel before any motion is drafted.
The burden. The defendant bears the burden of showing good cause by clear and convincing evidence. The California Supreme Court set that standard in People v. Cruz (1974) 12 Cal.3d 562, explaining that mistake, ignorance, or any other factor overcoming the exercise of free judgment is good cause, but that the defendant must prove it. The court reaffirmed the clear and convincing requirement in People v. Fairbank (1997) 16 Cal.4th 1223. A judge's ruling on the motion is reviewed for abuse of discretion, which means the trial judge's view of the evidence and the defendant's credibility usually controls.
What Counts as Good Cause to Withdraw a Plea
Mistake or ignorance about a direct consequence. A defendant who was not told, and did not understand, a direct consequence of the plea may have good cause. Direct consequences include the maximum sentence, mandatory parole or supervision, sex offender registration, a strike designation, and immigration consequences. Before accepting a plea, the court must advise the defendant of the constitutional rights being waived under Boykin v. Alabama (1969) 395 U.S. 238 and In re Tahl (1969) 1 Cal.3d 122, and a defective advisement is a recognized basis for withdrawal. The plea form, which in most Southern California counties is form CR-101 or a local equivalent, is the first document the judge will examine to see what was advised and initialed.
Pressure, coercion, or inadequate time. A plea entered because counsel insisted in the hallway minutes before the hearing, because the defendant believed a family member would be arrested otherwise, or because the defendant did not have time to read the form can be withdrawn if the evidence shows the pressure actually overcame free will. Judges are skeptical of this claim when the transcript shows the defendant answered yes to every question about voluntariness, so the motion needs more than the defendant's own declaration. Declarations from family members, a timeline of the attorney contacts, and the attorney's own file are the usual supporting evidence.
Incapacity at the time of the plea. A defendant who was under the influence of medication, in acute mental health crisis, in severe withdrawal, or otherwise unable to understand the proceedings may show good cause. Medical records, jail medical logs, and a doctor's declaration are the evidence that carries this ground. Where a mental health condition is involved, the case may also be a candidate for mental health diversion under Penal Code section 1001.36, described in mental health diversion under Penal Code 1001.36.
Ineffective assistance of counsel. If the plea resulted from advice that fell below professional norms and the defendant would not have pleaded guilty with competent advice, the plea may be withdrawn. The federal standard comes from Hill v. Lockhart (1985) 474 U.S. 52, which requires a reasonable probability that, but for counsel's errors, the defendant would have insisted on going to trial. Common examples are counsel who failed to investigate an obvious defense, failed to obtain discovery such as body camera footage before advising a plea, or misstated the sentence exposure. A defendant raising this ground usually needs new counsel, since the original attorney cannot credibly argue their own ineffectiveness, and the attorney-client privilege as to the plea advice is generally waived by the motion.
A plea bargain the court will not honor. Under Penal Code section 1192.5, when a plea is entered on a negotiated disposition and the court later withdraws its approval, for example after reading the probation report, the defendant must be permitted to withdraw the plea. This is not a good cause motion at all; it is an absolute right. The same section requires the court to find a factual basis for a negotiated plea, and a record with no factual basis is an independent ground for relief.
What Does Not Count as Good Cause
Buyer's remorse. The most common reason people want to withdraw a plea is that the sentence turned out to be harsher than hoped, the consequences at work or at home became real, or a friend said the case could have been beaten. None of that is good cause. In People v. Nance (1991) 1 Cal.App.4th 1453, the Court of Appeal held that a plea may not be withdrawn simply because the defendant has changed his mind, and in People v. Hunt (1985) 174 Cal.App.3d 95 the court rejected a motion based on the defendant's later belief that he had a defense he chose not to pursue. The question is what the defendant knew and understood at the moment of the plea, not how the defendant feels about it afterward.
A hoped-for outcome that did not materialize. A defendant who expected probation but received jail, or expected a program but did not qualify, has good cause only if the expectation was created by a misrepresentation or a defective advisement. If the plea form stated the maximum exposure and the judge explained that sentencing was open, disappointment at sentencing is not a ground.
Collateral consequences that were not discussed. Historically, courts distinguished direct consequences, which must be advised, from collateral consequences, which need not be. Loss of a professional license, employment consequences, and civil liability have generally been treated as collateral. Immigration consequences were once in that category, but Padilla v. Kentucky (2010) 559 U.S. 356 held that defense counsel must advise a non-citizen client about deportation risk, and California now treats immigration advice as a core duty under Penal Code section 1016.3.
Immigration Consequences: Penal Code 1016.5 and 1473.7
The statutory advisement. Penal Code section 1016.5 requires the court, before accepting a plea, to advise the defendant on the record that the conviction may have the consequences of deportation, exclusion from admission, or denial of naturalization. If the advisement was not given and the defendant shows that the conviction may actually cause one of those consequences and that they would not have pleaded guilty had the advisement been given, the court must vacate the plea. The California Supreme Court explained the prejudice requirement in People v. Superior Court (Zamudio) (2000) 23 Cal.4th 183. This motion has no deadline, but delay can undermine the claim that the defendant would have acted differently.
The 1473.7 motion. Penal Code section 1473.7 allows a person who is no longer in criminal custody to move to vacate a conviction or sentence that is legally invalid because of a prejudicial error damaging their ability to meaningfully understand, defend against, or knowingly accept the actual or potential adverse immigration consequences of the plea. The error does not have to be the attorney's fault. In People v. Camacho (2019) 32 Cal.App.5th 998, the Court of Appeal held that a defendant's own failure to understand the immigration consequences can be the prejudicial error, without proving ineffective assistance of counsel. The California Supreme Court in People v. Vivar (2021) 11 Cal.5th 510 held that appellate courts review these rulings independently and that prejudice means a reasonable probability the defendant would have rejected the plea had they understood the immigration consequences, measured by the defendant's own priorities and ties to the United States rather than by whether a trial would have succeeded.
Timing and evidence. A 1473.7 motion must be filed with reasonable diligence after the person receives a notice to appear in immigration court or a final removal order, or after the conviction is used as a basis for an adverse immigration action. The motion is heard in the court of conviction, so a plea entered at the San Bernardino Justice Center is vacated there. The strongest motions include the plea transcript, the plea form, a declaration from the defendant describing what they understood, declarations from family members about the person's ties to the country, an immigration attorney's declaration about the consequences of the conviction, and, where possible, evidence of what alternative plea could have been negotiated. The United States Supreme Court's decision in Lee v. United States (2017) 582 U.S. 357 confirmed that a defendant with strong ties to the United States can show prejudice even when the evidence of guilt was overwhelming, because a rational person in that position might prefer a long shot at trial over certain deportation.
Deferred entry of judgment. People who completed a drug diversion program under the former deferred entry of judgment statute and had the charge dismissed may still face immigration consequences because the guilty plea was entered. Penal Code section 1203.43 allows those pleas to be withdrawn and the case dismissed on the ground that the advisement about immigration consequences was inaccurate, and the motion is granted as a matter of course when the eligibility requirements are met.
How the Motion Is Filed and Heard
The written motion. A motion to withdraw a plea is filed in the department where the plea was taken, supported by a memorandum of points and authorities, a declaration from the defendant, and any supporting declarations and records. If the motion is based on counsel's advice, the defendant will usually need substitute counsel first, and the court may require a hearing on the request for new counsel before reaching the plea issue. The prosecutor files an opposition, and the court sets an evidentiary hearing if the facts are disputed. In the Inland Empire, these hearings are typically set in the sentencing department at the Riverside Hall of Justice, the Southwest Justice Center in Murrieta, the San Bernardino Justice Center, or the Victorville courthouse, and in Los Angeles County at the courthouse of conviction, from the Clara Shortridge Foltz Criminal Justice Center to the Pomona and Van Nuys courthouses.
The hearing. The defendant usually testifies and is cross-examined by the prosecutor, which means the testimony must be consistent with the plea transcript, the plea form, and any prior statements. The original attorney may be called by either side. The judge then decides whether good cause has been shown by clear and convincing evidence. Because the trial judge's credibility findings are rarely disturbed on appeal, the motion should be prepared as the one real chance to make the record.
Appeal after a denial. If the motion is denied and the defendant wants to appeal the validity of the plea, Penal Code section 1237.5 requires a certificate of probable cause from the trial court, requested under rule 8.304 of the California Rules of Court within the time to file the notice of appeal, which is 60 days from the judgment or the order being appealed. A denial of a 1473.7 motion is separately appealable. Missing the appeal deadline generally forfeits the issue, so the decision to appeal must be made quickly.
What Happens If the Plea Is Withdrawn
The case goes back to the beginning. Withdrawing a plea does not end the case. The not guilty plea is reinstated, the original charges come back, and any counts that were dismissed as part of the bargain are restored. The prosecutor is no longer bound by the plea offer and may file additional charges that were held back, seek the original sentence exposure, or revisit bail. In a felony case, the preliminary hearing and trial rights are restored. A defendant who withdraws a plea should expect to litigate the case or negotiate again from a weaker position than before, since the prosecutor now knows the defendant will plead if the pressure is right.
Statements made at the plea. Under Evidence Code section 1153, a withdrawn plea of guilty and any statements made in connection with it are inadmissible against the defendant in the criminal case. That protection is what makes the motion possible without handing the prosecutor an admission, and it is one reason the factual basis for a plea should be stated as narrowly as the court allows.
Weighing whether to file. Because withdrawal reopens exposure, the decision is strategic. A person who pleaded to a misdemeanor with no jail and later learns of an immigration consequence may have everything to gain. A person who pleaded to one count in exchange for the dismissal of three others, and who received a favorable sentence, may be trading a known result for a worse one. The same analysis that governs accepting a plea in the first place, set out in should you take a plea deal in California, governs whether to try to undo it, and it should be done with the evidence in hand, as described in what makes a criminal case weak in California.
Avoiding the Problem: How to Enter a Plea You Will Not Need to Withdraw
Read the form and ask. The plea form lists the rights being waived, the maximum sentence, the immigration advisement, and the specific terms of the deal. Anything that is promised but not on the form or stated on the record is not part of the bargain. A defendant who does not understand a line should say so before initialing it, and a judge at the Rancho Cucamonga courthouse or the Victorville courthouse will stop and explain rather than accept a plea the defendant does not understand.
Get the discovery first. Many withdrawal motions trace back to a plea entered before the defense had the body camera footage, the lab results, or the witness statements. The timeline of a criminal case usually allows time to obtain discovery under Penal Code section 1054.1 before a plea is required, and the pretrial process is described in what a pretrial conference is in California criminal court. Early pleas at arraignment, which are common at the Victorville courthouse and the Barstow courthouse where people from Hesperia, Apple Valley, and Barstow want the case over quickly, should be entered only when the consequences are fully understood; Victorville criminal defense explains the local process.
Non-citizens. Every non-citizen should have the proposed plea reviewed for immigration consequences before entering it. Under Penal Code section 1016.3, defense counsel must provide accurate advice and must try to negotiate an immigration-safe alternative, and prosecutors must consider the avoidance of immigration consequences in plea bargaining. A plea to disturbing the peace or trespass instead of battery or theft often avoids the problem entirely, which is why those alternatives are discussed in disturbing the peace under Penal Code 415.
Understand the alternatives. Diversion under Penal Code section 1001.95 does not require a guilty plea at all, and a case resolved by diversion ends in a dismissal with no conviction to withdraw. The program is explained in misdemeanor diversion under Penal Code 1001.95. Where a conviction has already been entered and cannot be withdrawn, dismissal under Penal Code section 1203.4 using form CR-180 remains available after probation, as described in how to expunge a criminal record in California, though a 1203.4 dismissal does not eliminate immigration consequences.
Frequently Asked Questions
How long do I have to withdraw a guilty plea in California?
Before judgment, or within six months after probation is granted with imposition of sentence suspended. Penal Code section 1018 sets those limits. Once sentence has been pronounced and the six month probation window has passed, the remaining routes are a motion under Penal Code section 1473.7 for immigration-related error, a motion under Penal Code section 1016.5 for a missing immigration advisement, or a petition for writ of habeas corpus.
Can I withdraw my plea because I changed my mind?
No. A change of heart, regret about the sentence, or a later belief that the case could have been won is not good cause. People v. Nance and People v. Hunt reject exactly that argument. The motion must show that mistake, ignorance, coercion, incapacity, or bad advice overcame your free judgment when the plea was entered.
Can I withdraw a no contest plea the same way as a guilty plea?
Yes. A no contest plea under Penal Code section 1016 has the same effect as a guilty plea in the criminal case and is withdrawn under the same standard in Penal Code section 1018.
What if my lawyer told me to take the deal and I felt I had no choice?
That can be good cause, but it must be proven. Advice to accept a plea is not coercion by itself; most defendants who plead do so on counsel's recommendation. The motion succeeds when the evidence shows the attorney misstated the consequences, failed to investigate a defense, or applied pressure that actually overcame your will, and Hill v. Lockhart requires a showing that you would have gone to trial with competent advice. You will generally need a new attorney to bring the motion.
If I withdraw my plea, do I get the same deal back?
No. The plea bargain is gone. The original charges and any dismissed counts are reinstated, the prosecutor can seek the full exposure, and the case proceeds toward trial unless a new agreement is reached. Under Evidence Code section 1153, the withdrawn plea and the statements made with it cannot be used against you, but the evidence in the police reports still can.
Can I withdraw a plea from years ago because of immigration problems?
Possibly, under Penal Code section 1473.7. If you are no longer in criminal custody and the conviction is causing or threatening immigration consequences, Penal Code section 1473.7 allows a motion to vacate based on a prejudicial error in understanding those consequences, and People v. Vivar sets the prejudice standard. The motion must be filed with reasonable diligence once immigration action begins.
Talk to a Criminal Defense Lawyer Before or After a Plea
Gramling Law Group defends clients at the plea stage and in motions to withdraw or vacate pleas at the Riverside Hall of Justice, the Southwest Justice Center in Murrieta, the San Bernardino Justice Center, the Rancho Cucamonga courthouse, the Victorville and Barstow courthouses in the High Desert, the Clara Shortridge Foltz Criminal Justice Center and the Pomona, Van Nuys, and Long Beach courthouses in Los Angeles County, and the Orange County justice centers, serving the Inland Empire, Los Angeles County, Orange County, and all of Southern California except San Diego County. Daniel Gramling, Esq. offers flat-fee criminal defense and limited-scope options, including a limited-scope review of a proposed plea before you sign it. Call (909) 654-4575 or contact us through this website for a consultation.
This article is educational and is not legal advice. Reading it does not create an attorney-client relationship. It addresses California law only.
Related Guides From Gramling Law Group
Learn more about our criminal defense serving the Inland Empire, Los Angeles County, and Southern California.
Criminal defense in Riverside, San Bernardino, Los Angeles, and the Inland Empire.
Gramling Law Group
3600 Lime St, Bldg 2, Riverside, CA 92501
Phone: (909) 654-4575
Serving the Inland Empire, Los Angeles County, Orange County, and all of Southern California except San Diego in family law and criminal defense.
Follow Daniel Gramling on Instagram: @californiafamilylawyer




Comments