Home > widget-integration > FilterUrlHelper > removeQueryParamsHistory

FilterUrlHelper.removeQueryParamsHistory() method

Removes specific values from multiple query parameters in the URL.

Handles both shortened and full parameter names with multiple URL schemes. Efficiently processes multiple parameter removals in a single history operation.

Signature:

removeQueryParamsHistory(params: Array<{
		key: string;
		value: string;
	}>, options?: {
		isShortenUrlParam?: boolean;
		urlScheme?: number;
		preventPushHistory?: boolean;
	}): void;

Parameters

Parameter

Type

Description

params

Array<{ key: string; value: string; }>

Array of {key, value} pairs to remove. Each entry specifies a parameter key (long form) and the specific value to remove from that parameter.

options

{ isShortenUrlParam?: boolean; urlScheme?: number; preventPushHistory?: boolean; }

(Optional) Configuration options for history and URL handling

Returns:

void

Remarks

For URL scheme 2, updates sessionStorage for each parameter and rebuilds the combined URL representation. If all values are removed from a parameter, the parameter is completely deleted from both URL and sessionStorage.

Example

Remove multiple values in one operation:

this.urlHelper.removeQueryParamsHistory([
  { key: 'pf_brand', value: 'Nike' },
  { key: 'pf_color', value: 'Red' }
]);
// Removes Nike from brands and Red from colors