What also works in newer versions, if you can’t find the variable to delete it and reloading the asset doesn’t prompt you to remove it:
-
Add “UnrealEd” to your private dependencies, so you can include “Kismet2/BlueprintEditorUtils.h”
-
Make a function that can use FBlueprinteditorUtils::RemoveMemberVariable, with the parameters being the blueprint, and the exact name of the variable as shown in the editor window, including spaces.
-
Call this function in the editor, for example by using a BlueprintEditorUtility
Had to do this recently to clear out a variable that wasn’t showing up in the editor when I was many edits deep into a commit that I didn’t want to revert.