I am looking at the following memory layout:

... and I know that GLOBAL_STRING is an std::string. I created the following structure:

But retyping the global GLOBAL_STRING to std_string yields the following error message:

I assume this is because Ghidra has recorded references to the capacity and size field as well and is unwilling to remove these labels. I found no way to manually remove them, what is the proper way to do this?
Just clear any data types that are already defined in the memory locations covered by the structure. Ghidra won't clear data out unless they are UNDEFINEDxx data types.
The references don't matter.
Ah, thank you so much. That worked flawlessly.
Also, if you select the correct number of bytes, then you can apply the desired type
Most helpful comment
Just clear any data types that are already defined in the memory locations covered by the structure. Ghidra won't clear data out unless they are UNDEFINEDxx data types.
The references don't matter.