California Legal Blog

Contact Us for a Free Consultation

Withdrawing a Guilty or No Contest Plea in California Under Penal Code 1018

Posted by Bulldog Law | Nov 25, 2026

California Under Penal Code 1018

Updated November 2026 | The Bulldog Law | California Criminal Defense

A guilty or no contest plea in California can be withdrawn, but only with a judge's permission and only for good cause. Under Penal Code 1018 the request must be made before judgment, which usually means before sentencing, or within six months of a grant of probation. The defendant has to show by clear and convincing evidence that the plea was the product of mistake, ignorance, duress, or something else that overcame free judgment. Simply changing your mind is not enough, and if the motion succeeds, every original charge comes back.

People call our attorneys about this within days of a plea, often after learning of a consequence nobody mentioned. Time matters more here than in almost any other motion.

The rule

Penal Code 1018 provides that on the defendant's application, the court may permit a plea of guilty to be withdrawn and a plea of not guilty substituted, for good cause shown. The statute says it is to be liberally construed to promote justice. It applies equally to no contest pleas. California courts have also said, repeatedly, that pleas resulting from a bargain should not be set aside lightly and that finality is important. Judges have discretion, and their decisions are rarely reversed.

Deadlines

Situation

Deadline under Penal Code 1018

Plea entered, sentencing not yet held

Any time before judgment is pronounced

Probation granted with imposition of sentence suspended

Within six months of the order granting probation

Sentence imposed (jail, prison, or a suspended sentence)

Too late for section 1018; other remedies only

Good cause

Good cause means mistake, ignorance, inadvertence, fraud, duress, or any other factor overcoming the exercise of free judgment. Two things must be shown: that the factor existed, and that it mattered, meaning the defendant would not have entered the plea otherwise.

Grounds that can succeed

Grounds that usually fail

The lawyer did not explain, or misstated, a direct or serious consequence: immigration, sex offender registration, a strike, loss of a license

Regret or second thoughts

The defendant misunderstood the terms because of how they were described

Disappointment that the judge imposed the top of an agreed range

Threats, coercion, or improper pressure, including pressure to protect another person

Ordinary pressure of facing trial and a possible longer sentence

Impairment at the time of the plea: medication, mental illness, intoxication, language barrier without adequate interpretation

Nervousness or haste, where the plea form and transcript show understanding

The prosecution broke the agreement, or the court declined to follow it

A hope that new evidence might turn up

Newly discovered evidence that seriously undercuts the case, unknown at the time of the plea

A relative's or friend's opinion that the deal was a bad one

The record made when the plea was taken is the main obstacle. Initials on the form and answers of "yes" to the judge's questions are evidence that the plea was knowing and voluntary. A successful motion explains, with declarations and documents, why that record does not tell the whole story.

Ineffective assistance of counsel

Many motions rest on the advice of the lawyer who handled the plea. The defendant must show that counsel's performance fell below an objective standard of reasonableness and that there is a reasonable probability he or she would have insisted on trial with accurate advice. In Padilla v. Kentucky, the Supreme Court held that failing to advise a noncitizen of clear deportation consequences meets the first part of that test. If you believe your lawyer's advice was the problem, a different lawyer must bring the motion; compare your experience with the signs of a bad criminal defense attorney.

When the court rejects the bargain

Under Penal Code 1192.5, if the judge decides not to follow a plea agreement that specified the sentence, the defendant has an absolute right to withdraw the plea. No showing of good cause is needed. The exception is a defendant who violated a condition of release under a valid waiver.

How the motion works

  • Act immediately. Tell your lawyer, or a new one, before the sentencing date.
  • Substitute counsel if needed. If the claim involves your lawyer's advice, ask the court to appoint or allow new counsel for the motion.
  • File a written motion with a declaration from you describing what you were told, what you understood, and why you would not have pleaded. Add supporting evidence: medical records, immigration advice, messages, declarations from family present at the discussions.
  • Hearing. The judge may hear testimony, including from your former lawyer, who can be questioned about the advice given.
  • Ruling. Granted or denied. A denial can be appealed after sentencing with a certificate of probable cause.

What happens if the plea is withdrawn

The parties return to their positions before the plea. Charges and enhancements dismissed under the bargain are restored. The prosecution is no longer bound by its offer and may decline to make another. Anything you said at the plea hearing generally cannot be used against you, but the case proceeds toward trial with full exposure. Before filing, weigh the sentence you bargained for against what a conviction at trial could bring. For some people the right answer is to keep the plea and seek other relief.

After the deadline

  • Appeal. A notice of appeal must be filed within 60 days of judgment, and challenging the validity of a plea requires a certificate of probable cause from the trial court.
  • Motion to vacate for immigration advisement. Under Penal Code 1016.5, if the court failed to give the required immigration warning, the plea can be vacated without a time limit.
  • Penal Code 1473.7. A person no longer in custody can move to vacate a conviction because of a prejudicial error affecting the ability to understand the immigration consequences, newly discovered evidence of actual innocence, or racial bias. See Penal Code 1473.7 and our page on vacating a conviction.
  • Habeas corpus. Available while in custody or on probation or parole; see how to file a habeas petition.

Noncitizens should read our page on the deportation consequences of convictions before choosing a route.

Frequently asked questions

Can you withdraw a guilty plea in California?

Yes, with the court's permission. Under Penal Code 1018, a judge may allow a guilty or no contest plea to be withdrawn for good cause if the request is made before judgment, or within six months after probation was granted when no sentence was imposed. The defendant must prove good cause by clear and convincing evidence.

What is good cause to withdraw a plea?

Mistake, ignorance, fraud, duress, or any other factor that overcame the defendant's free and clear judgment when the plea was entered. Common examples are a lawyer's failure to explain a serious consequence, a misunderstanding of what the agreement provided, pressure or threats, and impairment by medication or mental illness. The defendant must also show that he or she would not have pleaded if properly informed.

Is changing your mind enough to withdraw a plea?

No. Regret, second thoughts, or learning that the sentence is harsher than hoped is not good cause. Courts call this buyer's remorse. Something must have been wrong with the plea when it was made.

How long do you have to withdraw a plea?

Until judgment is entered, which in most cases means until sentencing. If the court granted probation without imposing a sentence, the deadline is six months from the probation order. After that, the plea can be challenged only by other procedures such as an appeal, a motion under Penal Code 1473.7, or a habeas corpus petition.

What happens if my motion to withdraw the plea is granted?

The case returns to where it was before the plea. The original charges, including any that were dismissed as part of the bargain, are reinstated, the plea offer is gone, and you face trial with the full sentencing exposure. A successful motion can leave a person worse off, so the decision needs careful advice.

Can I withdraw a plea because my lawyer gave bad advice?

Yes, if the lawyer's performance fell below professional standards and there is a reasonable probability you would have rejected the plea and gone to trial with correct advice. Failure to advise a noncitizen that a plea carries deportation consequences is the best known example. A new attorney usually has to bring the motion, since your former lawyer cannot argue his or her own ineffectiveness.

Can I withdraw a plea after sentencing?

Not under Penal Code 1018 once judgment has been entered. Other routes may exist: an appeal with a certificate of probable cause filed within 60 days, a motion to vacate under Penal Code 1016.5 or 1473.7 based on immigration consequences or new evidence of innocence, or a petition for a writ of habeas corpus while still in custody or on supervision.

Does the judge have to let me withdraw my plea if I had no lawyer?

The statute is stronger in that situation. For a defendant who appeared without counsel when the plea was entered, the court must permit withdrawal on a showing of good cause, where for represented defendants the court may do so. Good cause still has to be shown.

Related reading from our attorneys

Pleaded and now think it was a mistake? The window may close at sentencing

The Bulldog Law's criminal defense attorneys review pleas for grounds to withdraw and act before the deadline. Call (888) 928-1609 or reach us online.

About the Author

Bulldog Law

Bulldog Law is a dedicated criminal defense, personal injury, and cryptocurrency dispute resolution firm with licensed attorneys and experienced support staff across California. Our team of trial attorneys, paralegals, and legal professionals brings decades of combined experience handling complex state and federal matters  including serious felonies, DUI, domestic violence, special education law, employment disputes, and high-stakes crypto fraud recoveries. We pride ourselves on thorough case preparation, aggressive advocacy, and personalized client service. Every blog post is researched and reviewed by members of our legal team to provide practical, up-to-date information for individuals and businesses facing legal challenges. If you need trusted legal representation or have questions about your case, contact Bulldog Law today at (888) 928-1609 for a confidential consultation. Offices throughout California including Glendale, Sacramento, San Francisco, San Diego, and more.

We offer criminal defense, immigration, personal injury and cryptocurrency legal services in both English and Spanish. Call us at (888) 928-1609 for a free consultation.


Menu