Well, you could have the child sent away to a foreign land under a new identity and protected by trusted allies. Or perhaps they are hidden within the confines of a monastery or a hidden palace chamber that only a select few know about.
Well, one way could be to disguise the child's identity and pass them off as someone else. Maybe give the child a new name and a different background story. Another option is to have a trusted ally take the child far away and raise them in anonymity.
You might hide the emperor's child by disguising their identity. For example, making them look like an ordinary peasant or giving them a false name and background. Also, you could have them raised by a trusted ally in a remote location unknown to others.
One way could be to have the child adopted by a trusted family in a remote area. Another option is to give the child a magical charm that makes them invisible to certain people. You could also have the child live in a hidden village protected by powerful magic.