Title: wp_link_pages
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘wp_link_pages’, string $output, array|string $args )

## In this article

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

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

Filters the HTML output of page links for paginated posts.

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

 `$output`string

HTML output of paginated posts’ page links.

`$args`array|string

An array or query string of arguments. See [wp_link_pages()](https://developer.wordpress.org/reference/functions/wp_link_pages/)
for information on accepted arguments.

More Arguments from wp_link_pages( … $args )

Array or string of default arguments.

 * `before` string
 * HTML or text to prepend to each link. Default is `<p> Pages:`.
 * `after` string
 * HTML or text to append to each link. Default is `</p>`.
 * `link_before` string
 * HTML or text to prepend to each link, inside the `<a>` tag.
    Also prepended to
   the current item, which is not linked.
 * `link_after` string
 * HTML or text to append to each Pages link inside the `<a>` tag.
    Also appended
   to the current item, which is not linked.
 * `aria_current` string
 * The value for the aria-current attribute. Possible values are `'page'`, `'step'`,`'
   location'`, `'date'`, `'time'`, `'true'`, `'false'`. Default is `'page'`.
 * `next_or_number` string
 * Indicates whether page numbers should be used. Valid values are number and next.
   Default is `'number'`.
 * `separator` string
 * Text between pagination links. Default is ‘ ‘.
 * `nextpagelink` string
 * Link text for the next page link, if available. Default is ‘Next Page’.
 * `previouspagelink` string
 * Link text for the previous page link, if available. Default is ‘Previous Page’.
 * `pagelink` string
 * Format string for page numbers. The % in the parameter string will be replaced
   with the page number, so ‘Page %’ generates "Page 1", "Page 2", etc.
    Defaults
   to `'%'`, just the page number.
 * `echo` int|bool
 * Whether to echo or not. Accepts `1|true` or `0|false`. Default `1|true`.

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

    ```php
    $html = apply_filters( 'wp_link_pages', $output, $args );
    ```

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

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

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

The formatted output of a list of pages.

  |

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

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

## User Contributed Notes

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