# Ignore Tracking Parameters When Matching Redirects

> Strips utm_*, fbclid, gclid and similar tracking parameters from the URL the Redirection plugin matches against, so a redirect still fires when a link arrives from a campaign.

- Type: PHP
- Runs: Run everywhere
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: redirection, utm, matching
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/redirection-ignore-tracking-params/

## Code

```php
$wpide_params = array( 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'msclkid', 'mc_cid', 'mc_eid' );

add_filter( 'redirection_request_url', function ( $url ) use ( $wpide_params ) {
    return is_string( $url ) && false !== strpos( $url, '?' ) ? remove_query_arg( $wpide_params, $url ) : $url;
} );
```

## Notes

Add parameters to $wpide_params. The visitor's analytics are unaffected because the original URL is only changed for matching.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Ignore Tracking Parameters When Matching Redirects" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
