We are currently on vacation until 13th May 2024, ticket responses maybe be longer than normal during this period, sorry for any inconvenience.

Get clean url for import

Closed

Import WP Addon - WooCommerce Updated 2 months ago 2 Replies

Dung asked 2 months ago on March 1, 2024 at 5:47 pm

I have an import that has url with \”?utm_flashsale=1\” parameter.

https://example.com/abc?utm_flashsale=1

What code I need (for Snippet codes) to remove any parameter & to get clean url (in my case, here is removing \”?utm_flashsale=1\”)

J

James replied Support Agent

2 months ago on March 1, 2024 at 10:09 pm

A code snippet to remove the query string from a url would be:

function iwp_hd_remove_all_args($url)
{
    $parts = explode('?', $url);
    return $parts[0];
}

And can be used by (replacing {/url} with your data selection):

[iwp_hd_remove_all_args("{/url}")]
DN

Dung replied

2 months ago on March 2, 2024 at 4:12 am

It's working. Thanks for your quick support.