Home > widget-integration > FilterUrlHelper > removeQueryParamHistory
FilterUrlHelper.removeQueryParamHistory() method
Removes a specific value from a query parameter in the URL.
This is different from deleteQueryParamHistory which removes the entire parameter. If the parameter has multiple values, only the specified value is removed.
Signature:
removeQueryParamHistory(key: string, value: string, options?: {
isShortenUrlParam?: boolean;
urlScheme?: number;
preventPushHistory?: boolean;
}): void;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
string |
The query parameter key to modify (long form, e.g., 'pf_brand') |
|
value |
string |
The specific value to remove from the parameter |
|
options |
{ isShortenUrlParam?: boolean; urlScheme?: number; preventPushHistory?: boolean; } |
(Optional) Configuration options for history and URL handling |
Returns:
void
Example
Remove one value from multi-value parameter:
// Current URL: ?pf_brand=Nike,Adidas,Puma
this.urlHelper.removeQueryParamHistory('pf_brand', 'Adidas');
// URL becomes: ?pf_brand=Nike,Puma