Unreal Engine 5 · Blueprint → C++
Remove From Parent in Unreal Engine 5 C++UE Docs
The Remove From Parent Blueprint node maps directly to UWidget::RemoveFromParent() in C++, which detaches a widget from the viewport or its parent panel.
Blueprint node & C++ equivalent
MyWidget->RemoveFromParent();What does the Remove From Parent node do?
Remove From Parent takes a widget off screen by removing it from whatever container it lives in, whether that is the viewport or a parent panel slot. It is the standard way to close a menu or HUD created in C++.
After removal the widget is no longer rendered, but the object can still be garbage collected later unless you keep a reference.
The C++ equivalent
Call MyWidget->RemoveFromParent() on a valid widget pointer. This is the C++ replacement for the deprecated Remove From Viewport flow and works for widgets added with AddToViewport as well as nested children.
If you intend to show the same widget again, store the pointer rather than recreating it, then call AddToViewport() once more when needed.
Frequently asked questions
How do you remove a widget from the screen in UE5 C++?+
Call RemoveFromParent() on the widget pointer, for example MyWidget->RemoveFromParent(). This works for widgets added to the viewport or to a parent panel.
Is RemoveFromViewport the same as RemoveFromParent in UE5?+
RemoveFromViewport was deprecated in favor of RemoveFromParent, which handles both viewport widgets and nested child widgets. Use RemoveFromParent in current UE5 code.