How can I remove annotations/comments when I use command line?

I am converting .doc/.docx documents to .txt with LibreOffice, but there are several annotations/comments in some .docx files. If I convert these .docx files with command line like this:

libreoffice --headless --convert-to txt path-to-my-doc.docx

I will get .txt file with annotations/comments , but I don’t want to save it.
So what can I do? thx! (I must finish this with command line)

Since you’re targeting .doc(x) files, this is not a common question but a Writer one. Please retag to writer and delete common. This will reach more conveniently the contributors who are susceptible to answer.

You cannot add/remove content/reformat documents using --convert-to command line. This operation is intended exactly for as close conversion as possible, keeping everything just as it was in the original document (of course, as much as possible for the format - e.g., you can’t save much to .TXT or .CSV - and limited to imperfectness of external format support - e.g., LibreOffice could do something wrong due to bugs in filters). --convert-to is not designed to make any changes into the document.

See also this similar question, with a hint how to do that using macros.