Formatting Issues

How to Fix Word Table of Contents Displayed as a Hyperlink

Phi Hung VoPhi Hung Vo Nov 4, 2026 868 views

Question details

The user needs to restore the normal view of a table of contents that is currently displaying as a hyperlink or field code in the document editor.

How to Fix a Word Table of Contents Displayed as a Hyperlink
Product
Word
Device & OS
not provided
Scenario
Viewing or editing a document where the table of contents appears incorrectly as code, despite showing up correctly in Print Preview or when copy-pasted.
Observed behavior
The table of contents appears as a field code (resembling a hyperlink with curly brackets) instead of the actual list of headings. Additionally, page numbers may incorrectly wrap to the next line when the table is updated.
Before you start

Ensure your keyboard's Function (Fn) key is not locked if you are using a laptop, as you may need to use a combination of the Fn key and function row keys for this fix.

Solution 1Recommended

Toggle Field Codes Using Alt+F9

Use this quick keyboard shortcut to switch the view from field codes back to the normal table of contents result.

Word uses dynamic field codes to generate elements like a table of contents. When the field code display setting is accidentally enabled, the TOC looks like a hyperlink containing code (e.g., {TOC \o "1-3"}). Print Preview still shows the correct table because it automatically renders the final field result.

1
Locate the TOC

Open your Word document and scroll to the page where the table of contents is displaying incorrectly as a hyperlink or field code.

2
Press Alt+F9

Press the Alt and F9 keys on your keyboard simultaneously. On some laptops, you may need to press Fn + Alt + F9.

3
Verify the change

The table of contents should immediately switch from the field code view back to the standard text layout displaying your document's headings and page numbers.

Toggle Field Codes Using Alt+F9
Quick Fix: Alt+F9 is a global toggle. It will switch all field codes in your document back to their standard display results instantly.
Manage Documents Efficiently

Easily Manage Table of Contents with WPS Office

WPS Office Writer offers a highly intuitive interface for inserting, updating, and formatting a Table of Contents without the confusion of exposed field codes. It is fully compatible with Microsoft Word formats.

  1. 1. Open your document: Launch WPS Office Writer and open your document containing formatted headings.
  2. 2. Insert Table of Contents: Navigate to the References tab on the top ribbon and click on the Table of Contents button.
  3. 3. Select a style: Choose from the available automatic styles or click Insert Table of Contents to customize the levels and tab leaders.
Automatically generate and update Tables of Contents with a single click.Fully compatible with Microsoft Word documents (.docx) and formatting styles.User-friendly interface that prevents accidental field code displays.Lightweight software with powerful formatting capabilities.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my table of contents look like { TOC \o "1-3" \h \z \u }?

This happens when the document editor is set to display field codes instead of field results. The text inside the curly brackets is the backend instruction used to build the table. Pressing Alt+F9 will hide the code and reveal the actual table of contents.

Why does Print Preview show the correct table of contents while the document shows a hyperlink?

Print Preview automatically forces the software to display the final output (the field results) rather than the underlying field codes, ensuring you see exactly what will appear on paper when printed.

How do I update the table of contents without revealing field codes?

Right-click anywhere inside the generated table of contents and select 'Update Field'. You will be prompted to update just the page numbers or the entire table. This action securely updates the data without toggling the field code view.

Can I prevent field codes from displaying by default in Word?

Yes. Go to File > Options > Advanced. Scroll down to the 'Show document content' section and uncheck the box that says 'Show field codes instead of their values', then click OK to save your preferences.