A certificate of probable cause is required to challenge the denial of a motion to vacate judgment for failure to properly advise of immigration consequences. By his plea of nolo contendere, appellant was convicted of Penal Code section 311.11, subdivision (a) (possession of child pornography), and granted probation. He then filed a motion to vacate the judgment, claiming the trial court failed to properly advise him of the immigration consequences of his plea as required by Penal Code section 1016.5. The trial court denied the motion and appellant filed a notice of appeal challenging the validity of his plea and requesting a certificate of probable cause. The request for a certificate was denied by the trial court and the appellate court dismissed the appeal. The appellate court then granted appellant’s motion to vacate the dismissal and appellant filed a notice of appeal from the denial of his motion. Finding the appeal to be essentially a challenge to the plea, the appellate court dismissed the appeal for lack of a certificate of probable cause. Penal Code section 1237.5 requires a defendant to obtain a certificate of probable cause unless the appeal is based solely on grounds occurring after the entry of plea and does not challenge the validity of the plea. The substance of the claim, rather than its timing, determines whether the claim is a challenge to the validity of the plea. The existence of a statutory basis for a motion to challenge the failure to give immigration consequences does not provide an exception to section 1237.5. If, as here, the trial court denied the request for a certificate, defendant may attempt to obtain relief through a writ of mandate requiring issuance of the certificate, so that the issue can be addressed with the direct appeal.