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

---

# apply_filters( ‘user_trailingslashit’, string $url, string $type_of_url )

## In this article

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

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

Filters the trailing-slashed string, depending on whether the site is set to use
trailing slashes.

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

 `$url`string

URL with or without a trailing slash.

`$type_of_url`string

The type of URL being considered. Accepts `'single'`, `'single_trackback'`, `'single_feed'`,`'
single_paged'`, `'commentpaged'`, `'paged'`, `'home'`, `'feed'`, `'category'`, `'
page'`, `'year'`, `'month'`, `'day'`, `'post_type_archive'`.

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

    ```php
    return apply_filters( 'user_trailingslashit', $url, $type_of_url );
    ```

[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#L65)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/link-template.php#L65-L65)

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

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

Retrieves a trailing-slashed string if the site is set for adding trailing slashes.

  |

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

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

## User Contributed Notes

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