Skip to main content
Sean5CF1
Inspiring
December 8, 2023
Answered

Remove all indexing markers/hidden/special characters

  • December 8, 2023
  • 2 replies
  • 2658 views

Hi All

Started to rebuild a new index for the next edtition of a 500 page manual

I used the existing INDEX template and found it difficult and confusing to remove all the redundant markers etc

 

This worked a treat - cleaned everything with no ghost markers to be found

 

Step 1.

  1. Open your whole book
  2. click on find/change
  3. under "find what" click on the @symbol
  4. click on markers --> then index marker
  5. leave change to: blank
  6. under search, search "all documents"
  7. Then "change all"

 

Step 2. (can you believe it?)

  1. remove unused topics
  2. from index menu check reference and book
  3. highlight (click on) any indexed topic
  4. go to top right menu and "remove unused topics"

 

Tah DAH - all index markers are deleted and your old index is clean ready to rebuild

Whew!! you're welcome 

 

 

All this SHOULD be an ID single click menu option. WHY?

  • For all of us who rebuild indexes for the same book/manual/document
  • requiring all old/dead/deleted (but not deleted) special or hidden characters
  • but require all styles and indexing setup to remain intact
Correct answer Peter Kahrel

You can use this one-liner to remove all index markers and all topics:

app.documents.everyItem().indexes.everyItem().topics.everyItem().remove();

 With your method you don't remove cross-references, by the way.

2 replies

Participant
March 12, 2025

This doesn't work for me in ID 2025. After deleting all of the index markers (there were only a few), each topic (there are hundreds, inherited from a previous book) still has a page icon with the letters "PN" next to it (in the References button). When you click on "Go to reference," nothing happens. When you generate the index, there are no page numbers next to the entries. But when you try to "Remove Unused Topics" from either the References or Topics button, nothing happens. Have to delete each topic one at a time.

Peter Kahrel
Community Expert
Community Expert
March 12, 2025

When you delete index markers the way Sean described (find index markers and replace with nothing) you remove the page references, not the topics. To remove topics, use that one-line script I showed. That will of course also remove any associated page references. Did you try that?

Participant
March 12, 2025

Sorry, I have no idea how to "use a script," not being a programmer. I assumed that "Remove Unused Topics" in the Index drop-down menu was supposed to remove unused topics. I'm open to using a script, but I would need instructions for how to do it. Thanks.

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
December 8, 2023

You can use this one-liner to remove all index markers and all topics:

app.documents.everyItem().indexes.everyItem().topics.everyItem().remove();

 With your method you don't remove cross-references, by the way.

Sean5CF1
Sean5CF1Author
Inspiring
January 8, 2024

Thanks Peter

What you've written there makes no sense to me, but if it works for you, good!

sean