How to Fix Word Randomly Inserting Page Numbers in Document Text
Question details
Random page numbers or fragments of words are unexpectedly inserted into the middle of document text, and these numbers change when the affected text is copied and pasted.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Editing a long and complex document, such as a dissertation, where formatting accuracy is critical.
- Observed behavior
- Numbers appear randomly throughout the paragraphs. When the user copies and pastes the affected text, the inserted numbers dynamically change, indicating they are not static text but likely hidden field codes or unresolved Track Changes.
Enable hidden formatting marks by pressing Ctrl+Shift+8 (or clicking the Show/Hide ¶ button on the Home tab) to clearly see where spaces and breaks occur, and create a duplicate of your document to safely test fixes without risking the original file.
Toggle and Delete Accidental PAGE Field Codes
Use this solution if you accidentally pressed the shortcut to insert dynamic page numbers directly into your paragraphs.
The most common cause for numbers changing dynamically when copied is the accidental insertion of a PAGE field code. The keyboard shortcut Alt+Shift+P inserts the current page number wherever your cursor is located.
Press Alt+F9 on your keyboard. This toggles the display of all field codes in your document, turning dynamic numbers into bracketed text like { PAGE }.
Scroll through your text or use the Find feature (Ctrl+F) to look for the { PAGE } codes that appear randomly within your paragraphs.
Highlight the entire bracketed { PAGE } field code and press the Delete or Backspace key to remove it.
Press Alt+F9 again to hide the field codes and return your document to the normal text view.

Review and Accept Track Changes
Track Changes can sometimes glitch or display unexpected numbering and formatting if the document has a long history of heavy editing.
Repair Document Corruption
If random numbers or parts of words persist, the document file itself may be suffering from data corruption.
Try WPS Office for Bug-Free Document Editing
If your Word documents keep suffering from random field code insertions, unexpected formatting glitches, or corruption, consider switching to WPS Office. It provides a highly stable, lightweight environment perfect for managing long documents like dissertations without the frustrating bugs.
- 1. Download and Install WPS Office: Visit the official WPS website, download the free version, and follow the simple installation prompts.
- 2. Open your document in WPS Writer: Launch WPS Writer, go to Menu > Open, and select your existing Word document to continue working without glitches.
- 3. Edit and save smoothly: Enjoy a stable editing experience and save your work directly in the .docx format to retain full compatibility.

Frequently Asked Questions
Why do the inserted numbers change when I copy and paste the text?
This happens because the inserted number is not standard static text. It is a dynamic field code (like the PAGE field). When copied to a new location or page, the field automatically updates its value based on its new position in the document.
What keyboard shortcut accidentally inserts page numbers in Word?
Pressing Alt+Shift+P simultaneously in Microsoft Word will instantly insert a PAGE field at the location of your cursor. This is a common shortcut that is easily triggered by mistake while typing quickly.
How can I tell if my Word document is corrupted?
Signs of document corruption include random characters or numbers appearing in the text, formatting that cannot be changed, repeated crashing when trying to save, or failure to open the file entirely. Using the 'Open and Repair' feature can usually fix minor corruption.




