Views Exposed filter UX: omit default and empty exposed filter values from URL

Created on 27 August 2017, over 7 years ago
Updated 24 January 2025, 12 days ago

When I use views exposed filter with pager, each pager link contains all arguments, used in exposed filter, so even if I don't touch any exposed filter values - pager url contains many garbage empty and default arguments, for example:

http://example.com/catalog?manufacturer=All&price[min]=&price[max]=&power[min]=&power[max]=&width[min]=&width[max]=&height[min]=&height[max]=&depth[min]=&depth[max]=&sort_by=field_price_value&sort_order=DESC&page=2

instead of clean way:
http://example.com/catalog?page=2

Same problem if I use exposed filter and change only one field value, URL contains all values, including empty and default:
http://example.com/catalog?manufacturer=Hypnotoad&price[min]=&price[max]=&power[min]=&power[max]=&width[min]=&width[max]=&height[min]=&height[max]=&depth[min]=&depth[max]=&sort_by=field_price_value&sort_order=DESC

This give many problems with search engine indexing of Views filter results - URL contains many unnecessary values, and if we add new field to exposed filter or reorder fields - each old URL filter will be changed, so search engines will see many new urls and will reindex it, and exclude them as duplicated content.

Best solution for this problem is compare current exposed filter values with default, remove empty and default values and leave only actual used defined values.

Feature request
Status

Active

Version

11.0 🔥

Component

views.module

Created by

🇦🇲Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024