First delete them from the database with this:
Administration > Tools > Batch update > Search and replace
Set search method to “regular expression”
Search for : [0-9] _UID .*(\n)* (copy this carefully as all characters, including spaces are critical)
Replace with nothing
I recommend running a few using just “update” first to satisfy yourself it is catching the correct rows, and only those, then use “update all”.
Once completed, export your tree. That will create a fresh GEDCOM file without those items.