Your request to delete all directly formatted text parts leads to the right way.
@Lupp may be able to provide you with a routine, let's see.
Regardless, you should understand the principles regarding styles in Writer.
For formatting single characters, words and parts of sentences, character formatting is recommended, and for everything else, paragraph formatting, if we leave out special cases like "pages", "tables", etc.
Maybe this description can help you to understand the methods:
[Professional text composition with Writer](https://wiki.documentfoundation.org/Videos/Professional_work_in_Writer)