How can I automatically remove certain index entries?

I accidentally added an index on all occurrences of a very common short word. Undoing is no option, I continued editing afte that. It seems libreOffice only allows me to remove them one by one with a lot of manual work.

But it should be possible to write a script which unzips .odt, removes those indexes from content.xml and correctly zips .odt again.

Usage would be

remove_odt_index file.odt targetA targetB …

Does such a script already exist?

There is an example bash script function, of the type indicated in the question, provided in this AOO forum thread. Here is an adapted version:

unzip -p "$1" content.xml | sed -r -e 's,<text:alphabetical-index-mark-(start|end)[^>]*>,,g' > /tmp/content.xml && n="$(basename "$1" .odt)"_removed.odt;
cp "$1" "$n" && zip -j "$n" /tmp/content.xml

Given doc_with_index.odt as input to the above bash script (, doc_with_index_removed.odt will be written out e.g., $ doc_with_index.odt

What do you do to add index?

You can select the word in the all document with Find & Replace (Ctrl+F Menu/Edit/Find&Replace).
Search: TheWord
Find all
This select all ocurrences of the word.
Apply the desired format.