Let $M$ be a transitive model of ZFC. For convenience let assume that $M$ is countable. Now let us consider the least undefinable ordinal $\vartheta_M$ which is not definable from elements in $M$ and $M$ itself as parameters. For example, if $\alpha$ is the height of $M$ then $\alpha+\alpha$ and $\alpha^2$ are definable from $M$, so they are (strictly) less than $\vartheta_M$. Since there are only countable possible formulas and $|M|$ possible parameters we only have $|M|$ definable ordinals from $M$, so $\vartheta_M<|M|^+$.
My question is whether forcing preserves the size of $\vartheta_M$. That is, if $M[G]$ is a generic extension of $M$ then $\vartheta_{M[G]} = \vartheta_M$? I guess that $\vartheta_M$ only depends on the height of $M$. Thanks for any help.
I should provide more precise notion of definability. The definition of $\vartheta_M$ I imagine is: for a transitive model $M$, a definable class $C\subseteq M$ (that is, we have a formula $\ulcorner\phi\urcorner$ and parameters $a_1,\cdots, a_n\in M$ such that $x\in C\iff M\models \ulcorner\phi\urcorner(x, a_1,\cdots, a_n)$) and a definable ordering $\prec$ over $C$ well-ordered if for every definable $X\subseteq C$ either $X$ is empty or $X$ have the $\prec$-minimum.
$(C, R)$ might not be well-ordered in $V$. However if it is well-ordered then we can find the ordinal isomorphic to $(C, R)$ and we consider the least ordinal $\vartheta_M$ not isomorphic to any $(C, R)$. In that sense I can argue that $\vartheta_M < |M|^+$.
To clarify, I think that what the OP is asking is:
(Note that I write this slightly differently from the OP: the OP asks for the least "undefinable" ordinal, but I think they are tacitly assuming that the "definable" ordinals are closed downwards, which is not at all obvious to me.)
Then the question is, if (according to $V$) $N$ is a generic extension of $M$, is $\alpha(N)=\alpha(M)$?
(Note that since $M\not\in M[G]$, it's not even obvious that $\alpha(M)$ is "increasing" in $M$! In fact, by modifying the below argument I think we can show that it's not.)
If I'm interpreting the question correctly, the answer is no: forcing can definitely change what ordinals are definable in this sense. For example, for $N$ a set model of ZFC (inside $V$), let $\alpha_N$ be the minimum of the ordinals $\alpha$ such that the continuum pattern $$\{i: 2^{\aleph_{\omega_\alpha+i}}=\aleph_{\omega_\alpha+i+1}\}$$ is in $N$. Then there's no reason we can't have a model $M$ such that $\alpha_M=0$, but a forcing extension $M[G]\in V$ such that $\alpha_{M[G]}=\theta_M$ (maybe the continuum patterns in $V$ look Cohen over $M$, and we happen to pick $G$ to match the relevant pattern exactly). Of course, the obvious way to do this involves a terrible $V$, but there's no reason it can't happen.
Note that it is crucial in this argument that $G$ be generic over $M$, but not $V$. Indeed, it's not hard to show the following:
Of course, we have to be a bit careful defining "$\alpha^{V[G]}$," but it's not hard.