How to Keep Word Index Page Number Links After Updating
Question details
The user needs a method to prevent hyperlinks on index page numbers from disappearing when the index is refreshed.

- Product
- Microsoft Word 2021
- Device & OS
- Mac (also applies to Windows)
- Scenario
- Updating a document index to reflect recent pagination changes.
- Observed behavior
- Updating the index automatically removes previously added hyperlinks on the page numbers, requiring them to be manually recreated.
Always save a backup copy of your document before running any VBA macros, as macro actions usually cannot be undone using the standard Undo feature.
Use a VBA Macro to Restore Index Hyperlinks
Applying a specialized VBA macro will automatically search your index and recreate the missing hyperlinks after a field update.
Because Microsoft Word regenerates the entire field code result when an index is updated, manual formatting and hyperlinks are overwritten. Utilizing a macro script (commonly provided in Microsoft Office Forums) is the most efficient way to restore these links without manually re-adding them one by one.
In your Word document, press 'Option + F11' on a Mac or 'Alt + F11' on a Windows PC to launch the Visual Basic for Applications editor.
Click 'Insert' in the top menu bar of the VBA editor and select 'Module' to create a blank workspace for your script.
Copy your index hyperlink restoration macro from your trusted source or forum, paste it into the new module window, and then close the VBA editor.
Return to your Word document, navigate to the 'View' tab, click on 'Macros', select the macro you just pasted, and click 'Run' to restore your index links.

Try WPS Office for Seamless Document Editing
If you frequently struggle with complex macro workarounds and field code limitations in Microsoft Word, consider switching to WPS Office. It provides a lightweight, highly compatible, and user-friendly environment for professional document editing without the steep learning curve or high costs.
- 1. Download WPS Office: Visit the official WPS website and download the installation package for your Mac or Windows computer.
- 2. Install the Software: Run the downloaded installer and follow the on-screen prompts to set up WPS Office on your device.
- 3. Open Your Document: Launch WPS Writer and open your existing .docx files to enjoy seamless editing and formatting without missing a beat.

Frequently Asked Questions
Why do hyperlinks disappear when I update my Word index?
When Word updates an index, it completely regenerates the field code results from scratch. This standard regeneration process overwrites any manual formatting, including custom hyperlinks, that you applied to the text after the index was initially generated.
Can I lock the index field to prevent links from being removed?
Yes, you can select the index and press 'Cmd + F11' on Mac (or 'Ctrl + F11' on Windows) to lock the field. However, doing this prevents the index from updating at all, meaning it won't reflect new pagination changes until you unlock it with 'Cmd + Shift + F11'.
Will this macro solution work on both Mac and Windows versions of Word?
Yes, standard VBA macros for Word generally function across both Mac and Windows operating systems. You simply need to ensure that macro execution is enabled within your software's security preferences or Trust Center.




