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

---

# adjacent_posts_rel_link( string $title = '%title', bool $in_same_term = false, int[]|string $excluded_terms = '', string $taxonomy = 'category' )

## In this article

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

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

Displays the relational links for the posts adjacent to the current post.

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

 `$title`stringoptional

Link title format. Default `'%title'`.

Default:`'%title'`

`$in_same_term`booloptional

Whether link should be in the same taxonomy term.

Default:`false`

`$excluded_terms`int[]|stringoptional

Array or comma-separated list of excluded term IDs.

Default:`''`

`$taxonomy`stringoptional

Taxonomy, if `$in_same_term` is true. Default `'category'`.

Default:`'category'`

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

    ```php
    function adjacent_posts_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
    	echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy );
    	echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy );
    }
    ```

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

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

| Uses | Description | 
| [get_adjacent_post_rel_link()](https://developer.wordpress.org/reference/functions/get_adjacent_post_rel_link/)`wp-includes/link-template.php` |

Retrieves the adjacent post relational link.

  |

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

Displays relational links for the posts adjacent to the current post for single post pages.

  |

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

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

## User Contributed Notes

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