[Documentation](https://groundhogg.io/documentation/) » [Filter Hooks](https://groundhogg.io/documentation/#doc-filter-hooks)

# groundhogg/unsubscribe_url

Published Wednesday, June 10, 2026 · Last updated Wednesday, June 10, 2026

Filters the unsubscribe URL generated for a contact. Use this to redirect unsubscribes through a custom preferences page.

```

apply_filters( 'groundhogg/unsubscribe_url', $url, $contact );
```

You will receive the generated URL string and the `Contact` object.

## Example

```

add_filter( 'groundhogg/unsubscribe_url', 'my_extension_custom_unsub_url', 10, 2 );

/**
 * Send contacts to a custom unsubscribe page.
 *
 * @param string               $url
 * @param \Groundhogg\Contact $contact
 *
 * @return string
 */
function my_extension_custom_unsub_url( $url, $contact ) {
    return add_query_arg( [
        'email' => urlencode( $contact->get_email() ),
        'token' => my_extension_generate_token( $contact ),
    ], home_url( '/email-preferences/' ) );
}
```
