Summary: Simple footnote markup
Version: 1.0.0
Prerequisites: pmwiki 2.0 and above
Status: Stable
Maintainer: TonyColley
License: GPL2+
Categories: Markup PHP55
Discussion: Footnotes-Talk

Questions answered by this recipe

Is there a way to automatically number footnotes and to have them all automatically displayed at the bottom of the page?


Download footnote.phpΔ, and place it in your cookbook directory. (See Notes below for a newer version.)

Add the following line to local/config.php


Wherever you want a footnote in your text, simply use the [^footnote text^] markup.

When you want to display all the footnotes you have so far, below a short blue horizontal rule, use the markup [^#^] (on a line by itself; it won't break the recipe to do otherwise, but it might look funky).

If you do not want the short blue horizontal rule, but just a listing of all the footnotes defined so far, use the markup [^@^] (on a line by itself, too).

You may have multiple occurrences of the listing markups; each one will display only the footnotes created in the text since the last listing markup. (So you can have footnotes at the end of each section of your text, for example.)


The original version of this recipe was extracted from MarkupExtensions for those of us who just want footnote capability without all the other extensions provided by that recipe.

You can put in the group footer the markup to display the footnotes, so authors don't have to remember to add it.

A newer version makes two improvements:

  1. When [^#^] is used, the blue line will only appear when footnotes actually exist on the page.
  2. Unlike the original version, it's compatible with PHP 5.5+.

To use the newer version, download footnote2.phpΔ instead of footnote.phpΔ, and put in your configuration file include_once("cookbook/footnote2.php"); instead of include_once("cookbook/footnote.php");

The new version is compatible with PmWiki 2.2.58 and newer, and has no requirements for PHP version. The original version is compatible with PmWiki 2.0 and higher, but requires PHP 5.4 or older.

Release Notes

  • New version that works in PHP 5.5+, and prevents gratuitous blue lines: footnote2.phpΔ
  • Slightly modified variant of original recipe to prevent gratuitous blue lines (<PHP 5.5): footnoteifany.phpΔ

See Also

  • MarkupExtensions
  • FootnotesExtended (an extension that makes separating the footnote text from the footnote reference possible; better for large footnote texts and if references to the same text reoccur)
  • Cookbook:AddFootnote - creates a GUI edit button to transform selected text into a footnote


  • jr (the MarkupExtensions recipe)
  • TonyColley
  • RandyB - modified to omit gratuitous blue lines and to work with PHP 5.5


See discussion at Footnotes-Talk

User notes +4: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.