How to Fix Incorrect StyleRef Heading Text in a Word Header
Question details
The user needs to stop a previous chapter's Heading 2 text from persisting in the header of a new chapter when using the StyleRef field.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Setting up document headers using StyleRef fields to dynamically display Heading 1 and Heading 2 text.
- Observed behavior
- When a new chapter begins (Heading 1) but lacks an immediate Heading 2, the header automatically pulls and displays the Heading 2 text from the preceding chapter.
Before applying dummy headings to correct your header, be aware that this workaround may alter your document's numbering scheme and Table of Contents (TOC). Be prepared to manually adjust your list numbering afterward.
Insert a Blank Dummy Heading to Reset StyleRef
Create an empty paragraph formatted as Heading 2 at the start of the new section to clear the previous heading text from the header.
The StyleRef field works by searching backward from the current page to find the specified style. If a new chapter doesn't contain a Heading 2, the field continues searching backward until it finds the last one used in the previous chapter.
By inserting a blank paragraph and styling it as Heading 2, you force the StyleRef field to pick up empty text, effectively clearing the outdated heading from your header.
Place your text cursor right after the Heading 1 text of your new chapter, before the regular body text begins.
Press the Enter key to create a new, empty line.
Select the empty line, go to the Home tab, and click on 'Heading 2' in the Styles gallery.
Check your document's header on that page. The previous Heading 2 text should now be gone, replaced by the blank space.

Format the Dummy Heading as Hidden Text
Hide the blank dummy heading to preserve your document layout while still clearing the header.
Manage Document Headers and Styles Seamlessly in WPS Writer
WPS Writer offers advanced style management and powerful header customization. You can easily insert dynamic fields, format complex headings, and control header behavior with a highly intuitive interface.
- 1. Open your document: Launch WPS Writer and open your .docx document.
- 2. Access Header and Footer: Go to the 'Insert' tab and click on 'Header and Footer' to enter editing mode.
- 3. Insert Field Codes: Use the 'Insert Field' option to add StyleRef codes accurately, ensuring your headers reflect the correct styles.
- 4. Manage Styles seamlessly: Use the Styles pane on the Home tab to efficiently manage your Heading 1 and Heading 2 formatting to prevent header overlap.

Frequently Asked Questions
Why does the StyleRef field show the wrong heading from a previous chapter?
The StyleRef field automatically searches the current page for the specified style. If it doesn't find it, it searches backward through previous pages. It will display the most recent instance it finds, which is why a previous chapter's heading appears if the new chapter lacks one.
Will the blank dummy heading show up in my Table of Contents?
Yes, unless you adjust it, a blank heading will likely appear as an empty line with a page number in your Table of Contents. You can manually delete this line from the TOC right before you save or print the final version of your document.
How do I fix my numbering sequence if the dummy heading disrupts it?
If inserting the blank Heading 2 changes your numbering (for example, making the next real heading 2.2 instead of 2.1), simply right-click the actual heading text, choose 'Set Numbering Value', and manually adjust it back to the correct sequence.




