Quick summary
California Penal Code 1018 lets you ask the judge to withdraw a guilty or no contest plea and plead not guilty instead. You must show “good cause,” such as a mistake, a misunderstanding or pressure that overcame your free judgment.
- Deadline: You must file before judgment, or within 6 months after probation is granted if entry of judgment was suspended. Other remedies may apply after that.
- Good cause: Common reasons are not understanding the plea’s consequences (such as deportation), being pressured or threatened, or getting bad advice from your lawyer. Simply changing your mind isn’t enough.
- If you win: The case goes back to where it was before the plea, and the prosecutor can bring back any charges that were dropped as part of the deal.
- If you lose: You may be able to appeal, but you usually need a certificate of probable cause first.
Penal Code 1018 PC is the California law that lets you withdraw a plea of guilty or no contest. A judge may grant the motion if you show good cause, for example because you:
- didn’t understand the consequences of the plea;
- didn’t enter the plea freely and voluntarily; or
- were not represented by a competent attorney.
This is the full text of the statute (as of November 2026):
1018. Unless otherwise provided by law, every plea shall be entered or withdrawn by the defendant himself or herself in open court. No plea of guilty of a felony for which the maximum punishment is death, or life imprisonment without the possibility of parole, shall be received from a defendant who does not appear with counsel, nor shall that plea be received without the consent of the defendant’s counsel. No plea of guilty of a felony for which the maximum punishment is not death or life imprisonment without the possibility of parole shall be accepted from any defendant who does not appear with counsel unless the court shall first fully inform him or her of the right to counsel and unless the court shall find that the defendant understands the right to counsel and freely waives it, and then only if the defendant has expressly stated in open court, to the court, that he or she does not wish to be represented by counsel. On application of the defendant at any time before judgment or within six months after an order granting probation is made if entry of judgment is suspended, the court may, and in case of a defendant who appeared without counsel at the time of the plea the court shall, for a good cause shown, permit the plea of guilty to be withdrawn and a plea of not guilty substituted. Upon indictment or information against a corporation a plea of guilty may be put in by counsel. This section shall be liberally construed to effect these objects and to promote justice.1
In plain terms: you can ask to withdraw your plea any time before judgment, or within 6 months after probation is granted if entry of judgment was suspended, and the judge decides whether you have shown good cause.
If the judge grants your motion, your case goes back to the stage before the plea, usually the arraignment, and you can plead not guilty.
If the judge denies the motion, the plea stands, and the case moves on to the sentencing phase of the criminal court process.
Even if the motion is denied, you may still be able to:
Our California criminal defense lawyers answer these common questions:
- 1. What is a motion to withdraw a plea?
- 2. What is a “good cause” showing?
- 3. What happens if I win my motion to withdraw a plea?
- 4. What happens if I lose my motion?
1. What is a motion to withdraw a plea?
California Penal Code 1018 lets you ask to withdraw a guilty or no contest plea. It applies in both misdemeanor and felony cases.
You do this by filing a motion with the court. You must file it either:
- before judgment (usually, before you are sentenced to probation, jail or state prison); or
- within 6 months after the court grants probation, if entry of judgment was suspended.2
If the judge grants the motion, your earlier plea is withdrawn and you can enter a plea of not guilty. A motion to withdraw isn’t the only route, though: the prosecutor or the judge can also back out of a deal, as we explain in our post on other ways a plea deal can be reversed.
People usually file this motion when they realize the plea wasn’t in their best interest, for example because they:
- found out the plea carries a penalty or consequence nobody told them about;
- believe their lawyer gave them bad advice (ineffective assistance of counsel); or
- were pressured into accepting a plea deal.
Example: Bill pleads guilty to robbery and admits he used a gun, because he was told he would get probation. The judge later finds Bill isn’t eligible for probation. Bill can move to withdraw his plea, since he likely wouldn’t have taken the deal if he had known.3
Once the 1018 deadline has passed, you can’t use this motion. Other options may still be available, such as a petition for a writ of habeas corpus while you are in custody, or a motion to vacate under Penal Code 1473.7 once you are out of custody, for example if you didn’t understand the plea’s immigration consequences.4
2. What is a “good cause” showing?
A California judge will grant a PC 1018 motion only if you show “good cause.” Regret about pleading guilty, or a change of heart once you see the sentence, is not enough.
Good cause generally means you entered the plea because of:
- mistake;
- ignorance;
- inadvertence; or
- any other factor that overcame your free judgment, such as threats or pressure.5
You must prove good cause by clear and convincing evidence.6 That is a higher standard than “more likely than not.” It means the evidence must make it highly probable that the reason you give is true.
In practice, good cause often comes from showing that you were:
- not represented by a lawyer when you entered the plea;
- not aware of important consequences of the plea;
- coerced into the plea;
- poorly advised by your lawyer; or
- unable to understand the proceedings because of a language barrier.
2.1. Not represented by an attorney
If you pleaded guilty or no contest without a lawyer, PC 1018 says the court must allow you to withdraw the plea when you show good cause.7 Your chances are best if the judge didn’t make sure you understood your right to a lawyer and chose to give it up.
If the judge did properly explain your right to counsel and you knowingly waived it, the lack of a lawyer alone usually won’t be enough.
2.2. Not aware of the consequences of the plea
You may show good cause by proving that you didn’t know about a significant consequence of the plea when you entered it. Common examples are not knowing that:
- the conviction carries mandatory jail or prison time;
- the plea could lead to the suspension or loss of a professional license; or
- the plea could have immigration consequences, such as deportation.
As to professional licenses, criminal defense attorney Michael Scafiddi explains:
“Oftentimes convictions affect professional licenses in California. This is a fact that many lawyers fail to tell their clients when they engage in plea bargaining or sentencing. If you are a professional, and at the time you enter a guilty or no contest plea you were not aware that your license could be at risk, you may prevail on this type of motion.”
Immigration consequences are a common basis for these motions. Before accepting a guilty or no contest plea, a California court must warn any defendant that a conviction may lead to deportation, exclusion from the U.S. or denial of naturalization. If the court didn’t give that warning and the conviction could have those effects, you can ask the court to vacate the judgment and let you withdraw the plea.8
In one older California Supreme Court case, a lawful permanent resident pleaded guilty to misdemeanor possession of marijuana without knowing the plea would make him deportable. The court held he could withdraw the plea.9 A lawyer who gives you wrong advice about immigration consequences can also be grounds to withdraw a plea.10
2.3. Coerced into a plea
A California court should allow you to withdraw a plea if you were threatened, coerced or improperly pressured into pleading guilty or no contest.
In one case, Steven Sandoval Jr. pleaded guilty to voluntary manslaughter and then moved to withdraw the plea. The trial judge denied the motion, but the Court of Appeal reversed because:
- a co-defendant had threatened to hurt Sandoval if he didn’t plead guilty; and
- the trial judge had put undue pressure on him to plead guilty.11
2.4. Not represented by a competent lawyer
Ineffective assistance of counsel is one of the most common grounds for a motion to withdraw a plea. For example, you may have grounds if your lawyer didn’t:
- properly investigate the case;
- explain the plea and its consequences correctly; or
- file and argue the right motions.
The key question is whether your lawyer’s work fell below an objective standard of reasonableness, and whether you would not have pleaded guilty without the lawyer’s mistakes. This can be hard to prove, because courts don’t like to second-guess a lawyer’s tactical decisions.
2.5. Prejudiced by a language barrier
If you didn’t speak English well and didn’t have a qualified interpreter, or the interpreter didn’t accurately translate what was happening, you may not have understood what you were agreeing to. That can be good cause to withdraw a plea.
3. What happens if I win my motion to withdraw a plea?
If you win a motion to withdraw your plea, your case essentially starts over at the arraignment stage, and you can plead not guilty.
But the prosecutor is no longer bound by any plea deal. Charges that were dismissed as part of the deal can be brought back.12 For example, if you pleaded guilty to trespass in exchange for dismissal of a grand theft charge, and then win a PC 1018 motion, the prosecutor can refile the grand theft charge.
So before filing, talk with your lawyer about whether going back to the original charges is worth the risk.
4. What happens if I lose my motion?
If you lose a motion to withdraw your plea, the plea stands. You may still be able to:
- appeal; or
- later get the conviction expunged.
4.1. The California appeals process
You can appeal a judge’s decision denying a motion to withdraw a plea. But because you pleaded guilty or no contest, you usually must first ask the trial court for a “certificate of probable cause” by filing a sworn statement explaining the legal grounds for the appeal.13
On appeal, the higher court asks whether the judge made a legal error or abused their discretion in denying the motion. In the Sandoval case above, for example, the Court of Appeal found an abuse of discretion and reversed.
4.2. California’s expungement laws
If you can’t withdraw your plea, you may be able to expunge the conviction later.
You can usually petition for an expungement under Penal Code 1203.4 once you have completed probation and are not currently charged with, serving a sentence for, or on probation for another offense.14 Related laws cover many people who weren’t granted probation.
An expungement doesn’t erase the conviction. It releases you from most penalties and disabilities of the conviction, and in most job applications you don’t have to disclose it. But it still appears on your record and can be used in some situations, such as a later criminal case or certain licensing applications.15
Legal references:
- California Penal Code 1018 PC (full text quoted above; last amended 1991): “On application of the defendant at any time before judgment or within six months after an order granting probation is made if entry of judgment is suspended, the court may, and in case of a defendant who appeared without counsel at the time of the plea the court shall, for a good cause shown, permit the plea of guilty to be withdrawn and a plea of not guilty substituted.”
- Penal Code 1018 PC (see note 1 above).
- People v. Caban (1983) 148 Cal.App.3d 706 (plea entered on the belief that probation was available). Shepardized November 2026: green.
- California Penal Code 1473.7(a) PC: “A person who is no longer in criminal custody may file a motion to vacate a conviction or sentence,” including when it “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.”
- People v. Griffin (1950) 100 Cal.App.2d 546, 548 (mistake, ignorance, inadvertence or other factors overreaching free judgment). Shepardized November 2026: yellow (criticized in People v. Nance (1991) 1 Cal.App.4th 1453 on the burden-of-proof point only).
- People v. Huricks (1995) 32 Cal.App.4th 1201, 1207-1208 (good cause must be shown by clear and convincing evidence). Shepardized November 2026: green.
- Penal Code 1018 PC (see note 1 above).
- California Penal Code 1016.5 PC (required advisement that a conviction “may have the consequences of deportation, exclusion from admission to the United States, or denial of naturalization,” and the remedy when the court fails to give it).
- People v. Superior Court (Giron) (1974) 11 Cal.3d 793, 798. Shepardized November 2026: yellow (limited or distinguished in some later cases; still cited by California courts for this rule).
- People v. Perez (2015) 233 Cal.App.4th 736, 741 (“Mistake, ignorance or any other factor overwhelming the exercise of free judgment is good cause for withdrawal of a guilty plea”; plea withdrawal based on counsel’s alleged misadvice about deportation). Shepardized November 2026: no negative treatment (cited by 16).
- People v. Sandoval (2006) 140 Cal.App.4th 111 (trial court abused its discretion in denying the motion to withdraw the plea). Shepardized November 2026: yellow (distinguished on a separate sentencing issue; modified on June 22, 2006).
- People v. Superior Court (Garcia) (1982) 131 Cal.App.3d 256, 258-259: “When a defendant withdraws his plea, the prosecutor is no longer bound; counts dismissed may be restored.” Shepardized November 2026: yellow (one cautionary citing case).
- California Penal Code 1237.5 PC: “No appeal shall be taken by the defendant from a judgment of conviction upon a plea of guilty or nolo contendere … except where” the defendant files a sworn statement “showing reasonable constitutional, jurisdictional, or other grounds going to the legality of the proceedings” and the trial court issues a certificate of probable cause.
- California Penal Code 1203.4 PC (dismissal after completion of probation; the person is “released from all penalties and disabilities resulting from the offense,” with listed exceptions, including use of the prior conviction in a later prosecution).
- Penal Code 1203.4 PC (see note 14 above).