In Washington, you can file a motion to withdraw your guilty plea either before or after you are sentenced. More commonly, you will be filing your motion after you are sentenced. This is mainly because you won't realize all the potentially negative consequences of you plea until after you are sentenced.
The criminal rule governing post-sentence motions is CrR 7.8. There is an analogous rule (CrRLJ 7.8) that applies in district and municipal courts.
What is the standard of review under CrR 7.8?
The law makes it harder to withdraw your guilty plea once you've been sentenced. Under CrR 4.2 (the pre-sentence rule), you have to establish "manifest injustice." But under CrR 7.8, you have to establish two things: (1) error and (2) prejudice,
Step #1: Error
If you can prove manifest injustice under CrR 4.2, then you can prove error for purposes of CrR 7.8. In other words, you show the court that your plea was involuntary because your attorney was ineffective or the trial judge erred in her description of the law.
Step #2: Prejudice
Under CrR 7.8, you have to prove that you suffered “actual and substantial prejudice” by pleading guilty. You would not have pleaded guilty, for example, had you known there was a chance you would be deported. Or had you known that you were only facing a maximum possible sentence of 5 years in prison (as opposed to life in prison, as the judge told you), you would have rolled the dice and gone to trial instead.
Unlike CrR 4.2, where you automatically prevail if you show manifest injustice, under CrR 7.8. a court “may” allow you to withdraw your plea. That is, the court has to "discretion" to deny your motion even if you meet the two requirements.