You can ask a California court to let you withdraw a guilty or no contest plea, but you must show good cause, and the timing of your request matters a great deal. The law is Penal Code section 1018. The motion is strongest when it is filed before sentencing and backed by evidence, not just regret. If you are facing a drug, DUI, domestic violence, sex offense or federal matter, an attorney should look at your plea before anything is filed. At Rubin Law, P.C. our criminal defense work in Los Angeles County includes courtroom advocacy and motions of this kind.
TL;DR
- Penal Code 1018 lets a defendant ask to withdraw a guilty or no contest plea for good cause shown, and you must make the request personally in open court.
- Good cause means mistake, ignorance or anything that overcame your free judgment, proven by clear and convincing evidence.
- Filing before judgment is entered is simplest. If judgment was suspended, a six-month window applies.
- After judgment, other routes exist: Penal Code 1016.5 and 1473.7 for immigration problems, and 1203.4 once probation is done.
- If the motion is granted, your guilty plea is replaced with a not guilty plea and the case goes forward.
Table of Contents
- What a motion to withdraw a plea does
- What counts as good cause
- Deadlines: before judgment and after
- How the process works step by step
- If the motion is granted
- Immigration-based routes
- Withdrawing a plea after probation ends
- We read plea withdrawals as a defense problem first
- Talk to a defense attorney about your plea
- FAQ
- Sources
What a motion to withdraw a plea does
A plea is a formal answer to the charge. Pleading guilty or no contest (also called "nolo contendere") ends the question of guilt and leads to sentencing. A motion to withdraw the plea asks the judge to undo that answer.
Section 1018 says the court may permit a guilty plea to be withdrawn and a not guilty plea substituted, for good cause shown. The same page says the section is to be liberally construed to promote justice. It applies to misdemeanors and felonies alike.
The statute also requires that a plea be withdrawn by the defendant personally, in open court. Your lawyer prepares and argues the motion, but you appear and make the request yourself.
This is not a do-over because the deal felt worse later. Judges decide these motions with discretion, and the burden is on you.
What counts as good cause
California courts describe good cause broadly but demand proof. According to the Court of Appeal in People v. Castaneda (1995), mistake, ignorance or any other factor overcoming the exercise of free judgment is good cause. That same decision says it must be shown by clear and convincing evidence, a higher bar than "more likely than not." The court may also weigh how long you waited to file.
In practice, the facts that support these motions include:
- Misunderstanding the deal. You believed the plea carried a different sentence, or did not understand a term of the agreement.
- Not being told the consequences. This is especially important for non-citizens, covered below.
- Pressure or circumstances that overcame your judgment. Coercion, serious confusion or similar factors.
- Problems with how your lawyer advised you. An incorrect understanding of the law or the evidence when you decided.
A weak motion shows what the standard looks like. In People v. Roberts (2015), an unpublished decision, a defendant pleaded no contest to first-degree burglary believing he had to be sentenced before he could get a jail pass to visit his dying mother. He had a lawyer throughout. The trial court found no mistake, ignorance of the law or emotional trauma enough to overcome his judgment, and the appeal court affirmed the denial. A personal reason for pleading, without evidence that your free judgment was overcome, is rarely enough.
That is why the evidence package matters: a sworn declaration from you, communications with your prior attorney, the plea form, and the transcript of what the judge said at the plea hearing.
Deadlines: before judgment and after
Timing is where most people get tripped up. The statute speaks of the period before judgment, and courts have built rules around it.
Before judgment is entered. This is the cleanest path. You file before sentence is pronounced, and the court applies the good cause standard.
When sentence was suspended (often probation). In People v. Williams (2011), the court held the key question is whether judgment was entered or suspended. If the court suspended imposition of sentence, no judgment is pending, and a motion must be brought within six months. The distinction is not probation versus prison but entered versus suspended judgment.
After judgment. Section 1018 is limited on its face to the period before judgment. But the Castaneda court noted that courts have long allowed defendants to move to set aside the judgment as a way to withdraw a guilty plea afterward. A later unpublished decision, People v. Roberts, says the showing needed is the same as under section 1018.

Because delay can count against you and because the six-month window can close, do not wait to find out which category you are in. A defense attorney can read your minute orders and tell you.
How the process works step by step
- Get the record. Collect the plea form, the minute order from the plea hearing and the sentencing paperwork. These show whether judgment was entered or suspended, which sets your deadline.
- Identify the ground. Decide what actually went wrong: a misunderstanding, missing advice about consequences, pressure, or another factor. The motion rises or falls on this. At Rubin Law, we raise constitutional challenges and know how local judges and prosecutors handle a case, which shapes how a motion is framed.
- Build the evidence. Because the standard is clear and convincing evidence, you need more than your own statement. Declarations, records and prior counsel's file all help.
- File and set a hearing. The motion is filed in the court where you entered the plea. The prosecutor can oppose it.
- Appear personally. Section 1018 requires the plea to be withdrawn by you in open court, so you attend the hearing.
- Ask for the right relief. The request is to withdraw the plea and enter a not guilty plea, and where the judgment has been entered, to vacate it.
The decision is in the judge's discretion, as noted in Castaneda. That is why preparation counts more than the label on the motion.
If the motion is granted
A granted motion puts you back where you were before the plea: the guilty plea comes out and a not guilty plea goes in. The charge is live again. The prosecutor can pursue the original charges, and that may include counts that were dropped as part of the deal.
That risk is real and should be weighed before filing. A plea that looked harsh may still be better than a trial on the full original charges. We go through that tradeoff with clients before a motion is filed, using the evidence in the case. Our page on how plea bargaining works in California explains what is typically on the table.
Immigration-based routes
For non-citizens, a plea can bring deportation, denial of naturalization or inadmissibility. California has specific statutes for this.
Penal Code 1016.5. The court must advise a non-citizen defendant on the record that a conviction may lead to deportation, exclusion or denial of naturalization. If it failed to, and you show possible immigration consequences, the court on motion shall vacate the judgment and permit withdrawal of the plea. If there is no record of the advisement, you are presumed not to have received it. Under Castaneda, you must show you did not know of the possible consequences, that you would not have pleaded had you known, and that you moved with reasonable diligence.
Penal Code 1473.7. If you are no longer in criminal custody, you can move to vacate a conviction for specified reasons: legal invalidity tied to immigration consequences, newly discovered evidence of actual innocence, or a conviction based on race, ethnicity or national origin. If the conviction came from a plea and is vacated, the court shall allow withdrawal of the plea. The Judicial Council publishes a standard order for these motions, form CR-188. Our page on vacating convictions for immigration relief covers it in more depth, and so does our article on aggravated felony consequences.
If you are not a citizen, tell your attorney at the first call. It changes which statute you use and how fast you must move.
Withdrawing a plea after probation ends
A different set of statutes lets you withdraw a plea as a form of record relief, not because the plea was defective.
- Section 1203.4. If you completed probation, or the court grants relief in the interest of justice, you can withdraw the plea, enter a not guilty plea and have the case dismissed, as long as you are not serving a sentence, on probation or charged with another offense. The conviction can still be used in a later prosecution and must be disclosed in response to a direct question on applications for public office, licensure or state lottery contracting. The statute excludes specified sex offenses.
- Sections 1203.41 and 1203.42. For some felony sentences, a court can grant similar relief in its discretion after a waiting period (one or two years depending on the sentence), with 15 days' notice to the prosecutor.
- Section 1203.43. For people who completed a deferred entry of judgment program, the court on request shall permit withdrawal of the plea because earlier statements about its effects were misinformation. This matters for drug diversion cases; see our page on PC 1000 drug diversion.
These routes need no proof of a defective plea, but they do not erase a conviction for every purpose. Our expungement practice handles these petitions.
We read plea withdrawals as a defense problem first
Most people who call us about a plea they regret want to know one thing: can it be undone? The honest legal answer starts with a different question: what is the evidence that your judgment was overcome, and what happens to your case if the plea comes out?
Our approach is built on being in court often. We appear in Los Angeles County courtrooms regularly, so we know how local judges and prosecutors respond to motions and how they treat a defendant who comes back after a deal. That lets us weigh whether a motion to withdraw is the best move, or whether a constitutional challenge, a diversion program or record relief gets you further.
You get direct attention from an attorney, not a form motion. We build the record, prepare you for the day you must stand and speak for yourself in open court, and plan for what comes after a granted motion.
If you took a plea in a drug, DUI, domestic violence, sex offense or federal case and now believe it was a mistake, bring us the paperwork early. Deadlines are the part you cannot get back.
Jake
Talk to a defense attorney about your plea
If you pleaded in a Los Angeles County case and want to know whether your plea can come out, Rubin Law, P.C. handles criminal defense across drug crimes, DUI, domestic violence, sex offenses, violent crimes and federal charges, including pre-file intervention and alternative sentencing. Bring your plea paperwork and sentencing minute order so we can tell you which deadline applies.

See our criminal defense practice areas or reach us through rubinlawpc.com.
FAQ
Can you withdraw a guilty plea in California?
Yes. Penal Code 1018 allows it for good cause shown, and you must make the request personally in open court. The court has discretion, and you carry the burden of proving good cause with clear and convincing evidence.
How long do you have to withdraw a guilty plea?
Before judgment is entered, you can file at any time. If entry of judgment was suspended, as in many probation grants, courts have required a motion within six months. After judgment, other routes such as 1016.5 or 1473.7 may apply, and delay can count against you.
What happens if my motion to withdraw is granted?
Your guilty plea is replaced by a not guilty plea and the case continues. The prosecutor may pursue the original charges, so the decision to file should include a look at what you would face without the deal.
Can I withdraw a plea because of immigration consequences?
Possibly. Sections 1016.5 and 1473.7 address inadequate advisement and immigration-related invalidity. You must show you were unaware of the consequences and would not have pleaded had you known, and that you acted with diligence.
Sources
- California Penal Code, Part 2, Title 6 (leginfo)
- People v. Castaneda (1995) 37 Cal.App.4th 1612
- People v. Williams (2011)
- People v. Roberts (2015)
- Penal Code 1473.7
- Judicial Council form CR-188
- Penal Code 1203.4
- Penal Code 1203.41
- Penal Code 1203.43
