Title: Code Snippet to shorten parameter string
Last modified: March 5, 2024

---

# Code Snippet to shorten parameter string

 *  Resolved [peeld](https://wordpress.org/support/users/peeld/)
 * (@peeld)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/code-snippet-to-shorten-parameter-string/)
 * I have a really long string of parameters that I’d like to somehow shorten up
   so that this link:
   [https://www.yoursite.com/?tl_inbound=1&tl_groups%5B0%5D=27316&tl_groups%5B1%5D=27293&tl_form_type=1&tl_period_type=3](https://www.yoursite.com/?tl_inbound=1&tl_groups%5B0%5D=27316&tl_groups%5B1%5D=27293&tl_form_type=1&tl_period_type=3)
   Could be instead displayed as:[https://www.yoursite.com/?subscribers-only](https://www.yoursite.com/?subscribers-only)
   I have zero idea how to do this, anybody have any examples I can look at? I want
   to do this so that I can pass prettier links to my email subscribers. Thanks 
   in advance.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [2 years ago](https://wordpress.org/support/topic/code-snippet-to-shorten-parameter-string/#post-17777988)
 * Here’s an example snippet that will redirect users from `?subscribers-only` to
   your longer link:
 *     ```wp-block-code
       add_action( 'template_redirect', function () {
           if ( isset( $_GET['subscribers-only'] ) ) {
                wp_redirect( 'https://www.yoursite.com/?tl_inbound=1&tl_groups%5B0%5D=27316&tl_groups%5B1%5D=27293&tl_form_type=1&tl_period_type=3' );
           exit;
           }
       } );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Code Snippet to shorten parameter string’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/code-snippet-to-shorten-parameter-string/#post-17777988)
 * Status: resolved