Title: excerpt_remove_footnotes
Published: August 8, 2023
Last modified: February 24, 2026

---

# excerpt_remove_footnotes( string $content ): string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#wp--skip-link--target)

Parses footnotes markup out of a content string, and renders those appropriate for
the excerpt.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#parameters)󠁿

 `$content`stringrequired

The content to parse.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#return)󠁿

 string The parsed and filtered content.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#source)󠁿

    ```php
    function excerpt_remove_footnotes( $content ) {
    	if ( ! str_contains( $content, 'data-fn=' ) ) {
    		return $content;
    	}

    	return preg_replace(
    		'_<sup data-fn="[^"]+" class="[^"]+">\s*<a href="[^"]+" id="[^"]+">\d+</a>\s*</sup>_',
    		'',
    		$content
    	);
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/blocks.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/blocks.php#L2220)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/blocks.php#L2220-L2230)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_trim_excerpt()](https://developer.wordpress.org/reference/functions/wp_trim_excerpt/)`wp-includes/formatting.php` |

Generates an excerpt from the content, if needed.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/excerpt_remove_footnotes/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.3.0](https://developer.wordpress.org/reference/since/6.3.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fexcerpt_remove_footnotes%2F)
before being able to contribute a note or feedback.