Members Only

InQuestion: Removing Unwanted Text Anchors

Jamie McKee identifies a strange hidden character, tells where it came from, and how to get rid of it easily.


Jamie McKee identifies a strange hidden character, tells where it came from, and how to get rid of it easily.

Q: I’m setting chapters for a book that contains endnotes. My Word documents are properly styled, but when I place them into my InDesign template, they’re filled with hidden characters—always at the start of the text and usually before each endnote callout. I want my InDesign files error-free and these characters make me nervous. Any idea what they are and how to get rid of them?

A: Kudos to you for wanting your files clean and error-free—I wish more people worked that way! I’ve set quite a few Word documents as you describe and have run across this very issue.

The hidden character you’re describing is the Text Anchor character—a type of hyperlink destination. When you turn on Type > Show Hidden Characters, you can see a colon character (Figure 1). And if you choose Edit > Edit in Story Editor, you’ll see a colon followed by brackets around a bullseye.

Figure 1. Text as seen in both Normal View and the Story Editor with the Text Anchor special characters circled.

InDesign has a plethora of special characters, which you can see in the InDesignSecrets Guide to Special Characters. Another special character—the Cross-Reference Definition character—looks similar to the Text Anchor special character, except it doesn’t have the colon preceding the brackets and bullseye.

You can see all the Text Anchors in your text if you open the Bookmarks panel (Window > Interactive > Bookmarks). A bookmark is a type of link that makes it easier to navigate documents exported as Adobe PDF. Bookmarks within an InDesign document appear

in the Bookmarks tab on the left side of the Acrobat or Adobe Reader window as long as the Include Bookmarks option was selected when the PDF was created. Each bookmark jumps to a text anchor or page. For example, entries in a generated table of contents are automatically added to the Bookmarks panel. In addition, you can further customize your document with bookmarks to direct a reader’s attention or make navigation easier. If, however, your book is only going to print, you have nothing to worry about—Text Anchor special characters don’t print and introduce no spacing issues into your document.

Removing Unwanted Text Anchors

To rid your InDesign document of the Text Anchors, simply select them all in the Bookmarks panel, and click the Delete button.

If you’re wondering where they came from, well, they originated in the Microsoft Word file. You can view the bookmarks in the Word file by choosing Insert > Bookmark (Figure 2). Make sure to turn on the “Hidden bookmarks” option to see all of them. Unfortunately, you can only delete bookmarks one at a time in Word, so for this reason I ignore them in Word and delete them all at once in InDesign.

Figure 2. Microsoft Word’s Bookmarks dialog box.

Finally, I should point out that if you are placing .docx files, you will end up with at least one Text Anchor named “_GoBack” when you place the file into InDesign. This is an artifact of the feature in Word that allows you to jump back to the previous location of your cursor by pressing Cmd+Option+Z on the Mac or Ctrl+Alt+Z on Windows. This seems to be unique to .docx files. You won’t see _GoBack bookmarks when you place .rtf, .doc, or .txt files into InDesign.

Bookmark
Please login to bookmark Close

Not a member yet?

Get unlimited access to articles and member-only resources with a CreativePro membership.

Become a Member

Comments (8)

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Tamás Nagy

    Thank you very much for the warning, David! You’re right, this code can badly ruin things. Fortunately, we don’t use those bookmarks or other types of links in our printed books at all, but they often make our job more complicated. So for us killing all of them by a script is like a lifebelt. We always delete all xml contents as well, together with all the labels.

  2. Tamás Nagy

    I found another type of these Text Anchor-like things: this type of hidden colon is always at the very beginning of some paragraphs, but there are no hyperlinks or bookmarks in the document at all.

    I can select this colon, and I can even paste it into the find what fields of both the text search and the grep search windows (^I or ~I appears there, as if it was a Text Anchor), but the search process results in no match. When I try the unicode value directly in the text search the result is the same: nothing.

    When I look at it in the Story Editor nothing can be seen there but the cursor can step over this nothing so at the beginning of the paragraph text I have to press right button twice to go over the first real letter of it.

    So it looks like we have no help, we have to remove these annoying “nothings” manually. This hidden character is very much in our way when scripting, since it is sometimes counted into the paragraph length, sometimes not, and it can cause a 1 character shift in text processing: the script result is often unusable.

    Fortunately I could figure out a scripted solution that removes this thing from the beginning of the paragraphs. Assuming that variable P points to a paragraph here is the line of code that does the job:

    if (P.contents.charCodeAt(0)==65279) P.characters[0].remove();

    It checks the same value but somehow this way InDesign behaves like a good boy and removes that badass character.

    1. Tamás Nagy

      As in the previous post the unicode values disappeared. It was FEFF again.

      1. David Blatner

        Tamás: Unfortunately code and pre work in our forums, but not in comments… I fixed it for you here.

        However, it is important to note that if you delete all the FEFF, you may delete more than you expected. InDesign uses that code for several important things. See: https://creativepro.com/topic/unknown-character/#post-111365

      2. Tamás Nagy

        Update: these vicious nothings may appear anywhere in the paragraph. So I modified the code to manage the inter-paragraph nothings as well (I hope the pre tag will work):


        pos=P.contents.indexOf("\uFEFF");
        while (P.contents.length>0 && pos>-1) {
        P.characters[pos].remove();
        pos=P.contents.indexOf("\uFEFF");
        };

  3. Mikael Johnsson

    I ran in to something similar a few years back. Unwanted hidden characters in imported word files. They looked like blue colons when i viewed the hidden characters.

    I read in a forum that you can search and replace these empty anchors by looking for in the search dialog box. Don’t know what that refers to – but that solution worked for me back then, and I’ve used it a couple of times since then.

    1. Mikael Johnsson

      I noticed that my comment removed the string i searched for:

      FEFF contained in chevron brackets.

  4. Hi, my friend, to fix this problem use notepad of Windows.
    How to do:
    First of all, copy your text to notepad (bloco de notas em português do Brasil).
    Now select the text from notepad and copy it.
    Now you can paste into Word or InDesign without this signals.
    The notepad eliminate all off these crazy hiden signals :)

    Ps.: if I wrote wrong, very hard mistake with the English language, tell me and I’ll try explain better :)