In California, the Judge is required to tell anyone in a criminal case the consequences of a plea of guilty. Among these consequences re those pertaining to immigration. The Court cannot ask a defendant if they are here legally or what their status is. The Judge must inform everyone as follows:
If you are not a citizen of the United States, you should assume that
your plea of [guilty/no contest] will result in your deportation from the
United States, exclusion from admission to the United States, or denial of
naturalization as a United States citizen. Do you understand that?
It is highly recomended that The court should give the Pen C §1016.5
advisement to all defendants because the court may not inquire
into a defendant’s legal status. See Pen C §1016.5(d); People v
Aguilera (1984) 162 CA3d 128, 133, 208 CR 418.