w:ftr (Footer)

Root element of a footer part (footer1.xml, etc.), containing block-level content rendered at the bottom of each page.

Description

w:ftr is the root element of a footer part (footer{n}.xml). It is defined in ECMA-376 Part 1 §17.10.2.

The footer part is a separate XML file linked from the main document part via a w:footerReference relationship inside w:sectPr. Like w:hdr, it may contain any combination of paragraphs (w:p) and tables (w:tbl), and must contain at least one paragraph. Footer content is rendered at the bottom of each page. Common uses include page numbers, document titles, dates, and copyright notices.

Multiple footer parts can exist (e.g., footer1.xml, footer2.xml) for different sections or page types (default, first, even/odd). The footer is typically placed below the document margins, with its distance from the page edge defined by w:pgMar w:footer in w:sectPr.

Attributes

Attribute Type Possible Values Description
(none) — — Content is expressed entirely via child paragraphs and tables.
Type Usage Purpose
default Standard footer Applies to all pages (or odd pages if evenAndOddHeaders is set)
first First page footer Applies to first page only when w:titlePg is active
even Even-page footer Applies to even pages when w:evenAndOddHeaders is active

Examples

<!-- footer1.xml: centered page number -->
<w:ftr xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
  <w:p>
    <w:pPr>
      <w:jc w:val="center"/>
    </w:pPr>
    <w:r>
      <w:fldChar w:fldCharType="begin"/>
    </w:r>
    <w:r>
      <w:instrText> PAGE </w:instrText>
    </w:r>
    <w:r>
      <w:fldChar w:fldCharType="end"/>
    </w:r>
  </w:p>
</w:ftr>
<!-- footer1.xml: page X of Y format -->
<w:ftr xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
  <w:p>
    <w:pPr>
      <w:jc w:val="center"/>
    </w:pPr>
    <w:r><w:t>Page </w:t></w:r>
    <w:r>
      <w:fldChar w:fldCharType="begin"/>
    </w:r>
    <w:r>
      <w:instrText> PAGE </w:instrText>
    </w:r>
    <w:r>
      <w:fldChar w:fldCharType="end"/>
    </w:r>
    <w:r><w:t> of </w:t></w:r>
    <w:r>
      <w:fldChar w:fldCharType="begin"/>
    </w:r>
    <w:r>
      <w:instrText> NUMPAGES </w:instrText>
    </w:r>
    <w:r>
      <w:fldChar w:fldCharType="end"/>
    </w:r>
  </w:p>
</w:ftr>
<!-- footer1.xml: document info with border -->
<w:ftr xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
  <w:tbl>
    <w:tblPr>
      <w:tblW w:w="5000" w:type="pct"/>
      <w:tblBorders>
        <w:top w:val="single" w:sz="6" w:space="1" w:color="808080"/>
      </w:tblBorders>
    </w:tblPr>
    <w:tr>
      <w:tc>
        <w:p>
          <w:pPr><w:jc w:val="left"/></w:pPr>
          <w:r><w:t>Document Title</w:t></w:r>
        </w:p>
      </w:tc>
      <w:tc>
        <w:p>
          <w:pPr><w:jc w:val="right"/></w:pPr>
          <w:r><w:t>Page </w:t></w:r>
          <w:r><w:fldChar w:fldCharType="begin"/></w:r>
          <w:r><w:instrText> PAGE </w:instrText></w:r>
          <w:r><w:fldChar w:fldCharType="end"/></w:r>
        </w:p>
      </w:tc>
    </w:tr>
  </w:tbl>
</w:ftr>
Field Code Output Purpose
PAGE Page number Current page number (e.g., “5”)
NUMPAGES Total pages Total page count (e.g., “10”)
DATE \\@ "MM/dd/yyyy" Today’s date Current date (formatted)
TIME \\@ "hh:mm:ss" Current time Time (formatted)
FILENAME File name Document file name (without path)
TITLE Document title From document properties

Notes

  • Footer part file: Each footer is stored in its own XML file (e.g., footer1.xml, footer2.xml) in the word/ directory; linked from document.xml.rels.
  • Minimum content: A footer must contain at least one w:p paragraph; empty footers may cause compatibility issues.
  • Footer types: Reference type (default, first, even) is determined by w:footerReference w:type in w:sectPr, not by content in the footer itself.
  • Section-specific footers: Different sections can have different footers; each w:sectPr contains w:footerReference elements pointing to its respective footer parts.
  • Field codes: Use w:fldChar with types begin, separate (for result text), and end; the actual field instruction is in w:instrText or w:instrCode.
  • Field updates: Fields update when the document is opened in Word, when Print Preview is used, or when using “Update Fields” command.
  • Distance from page edge: Footer distance from page edge is defined by w:pgMar w:footer in w:sectPr; typically 720 twips (0.5 inches).
  • Accessibility: Footers are often excluded from accessibility readers; ensure critical content is in the main body if needed for screen readers.
  • Different first page: Use w:titlePg in w:sectPr with separate w:footerReference w:type="first" to have different footers on first page vs. subsequent pages.