Share via

Modify Header and Footer sample data

Anonymous
2026-04-03T16:40:20.62+00:00

can you delete all header and footer sample data in word

Microsoft 365 and Office | Word | For home | Other
0 comments No comments

3 answers

Sort by: Most helpful
  1. Stefan Blom 342.4K Reputation points MVP Volunteer Moderator
    2026-04-05T18:00:16.6733333+00:00

    You can run the following VBA macro. It clears all the content in all headers/footers in the active document.

    Sub DeleteHeadersFootersAll()
    'Basic VBA macro to delete all header and footer content
    'Created by Stefan Blom
    Dim s As Section
    For Each s In ActiveDocument.Sections
        s.Headers(wdHeaderFooterEvenPages).Range.Text = ""
        s.Headers(wdHeaderFooterFirstPage).Range.Text = ""
        s.Headers(wdHeaderFooterPrimary).Range.Text = ""
        
        s.Footers(wdHeaderFooterEvenPages).Range.Text = ""
        s.Footers(wdHeaderFooterFirstPage).Range.Text = ""
        s.Footers(wdHeaderFooterPrimary).Range.Text = ""
    Next s
    End Sub
    

    Was this answer helpful?

    0 comments No comments

  2. Arlene D 36,075 Reputation points Independent Advisor
    2026-04-03T19:24:50.15+00:00

    Hello,

    Are you trying to remove headers and footers from all pages or just specific ones?

    Open your document, double click at the top or bottom of any page to enter header or footer editing, then press Ctrl + A to select all content inside the header or footer and press Delete, next go to the Header and Footer tab and turn off Link to Previous for each section before repeating the same steps so it clears across all sections, then click Close Header and Footer to apply the changes which removes all remaining header and footer content everywhere.

    Was this answer helpful?

    0 comments No comments

  3. AI answer

    2026-04-03T16:40:31.75+00:00

    To delete all header and footer sample data in Word, use one of these methods.

    For a single section document (most common):

    Windows / macOS / Web

    1. Go to Insert > Header or Footer.
    2. Select Remove Header and repeat for Remove Footer.

    If the document has multiple sections:

    1. Place the cursor in a section that still shows a header or footer.
    2. Go to Insert > Header (or Footer).
    3. Select Remove Header (or Remove Footer).
    4. Repeat for each section that still displays header or footer content.

    This removes all header/footer sample text, watermarks (because they live in headers), and other header/footer content from the document.

    If working programmatically with a .docx file using the Open XML SDK, use the RemoveHeadersAndFooters method pattern:

    1. Open the document with WordprocessingDocument.Open(filename, true).
    2. Get doc.MainDocumentPart into a variable (for example, docPart).
    3. Delete header and footer parts:
         docPart.DeleteParts(docPart.HeaderParts);
         docPart.DeleteParts(docPart.FooterParts);
      
    4. Remove all HeaderReference and FooterReference elements from the main document XML as shown in the sample RemoveHeadersAndFooters method.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.