logo
search
Document Editing Problems

How to Fix Word Randomly Inserting Page Numbers in Document Text

Kushani NimanthikaKushani Nimanthika Sep 28, 2026 871 views

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.

How to Fix Word Randomly Inserting Page Numbers in Document Text
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.
Before you start

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.

Solution 1Recommended

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.

1
Reveal field codes

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 }.

2
Locate the unwanted fields

Scroll through your text or use the Find feature (Ctrl+F) to look for the { PAGE } codes that appear randomly within your paragraphs.

3
Delete the codes

Highlight the entire bracketed { PAGE } field code and press the Delete or Backspace key to remove it.

4
Hide field codes

Press Alt+F9 again to hide the field codes and return your document to the normal text view.

Toggle and Delete Accidental PAGE Field Codes
Tip: If you have many unwanted fields, you can use the Find and Replace tool (Ctrl+H) to search for ^d PAGE and replace it with nothing, but be careful not to delete legitimate page numbers in your headers or footers.
Free Microsoft Office alternative

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. 1. Download and Install WPS Office: Visit the official WPS website, download the free version, and follow the simple installation prompts.
  2. 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. 3. Edit and save smoothly: Enjoy a stable editing experience and save your work directly in the .docx format to retain full compatibility.
Completely free to use with a lightweight installation packageSeamless format compatibility with Microsoft Word (.docx, .doc)Stable environment for heavy editing and long documentsFamiliar interface requires no new learning curveBuilt-in PDF editing and document management features
microsoft office alternative - wps office

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.