Get clean url for import

Closed

Import WP Addon - WooCommerce Updated 3 months ago 2 Replies

Dung asked 3 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

3 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

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

It's working. Thanks for your quick support.