Hello,

I'm asking for help with advice on how to solve the following problem:

In a page created using Views, I created an exposed filter that allows filtering nodes that contain a selected value in an integer field of the nodes in this view. It's a product characteristic expressed as a number.

For site visitors, this works fine, but Google sees many different pages with a different URL, corresponding to each of the numeric values ​​allowed in the field. The problem is that for all these different pages / urls, the search engine finds the same title and meta description, which is a problem for optimizing the site (SEO).

I suppose that this is a problem that is common when using exposed filters and probably a solution has been found long ago, but I can't think of a working system of settings that would fix the problem.

I would be grateful for any guidance or idea for finding a solution.

Accepted answer

Thanks again. The advice helped me with a little extra help from Chat GPT:

Other
Use AJAX: Yes

Comments

Have you tried using AJAX for the filters so the page loads once?

Another option is the submodule of Metatag - Metatag Views - you can set the canonical url

You can also add View arguments for that might help too.

The problem is that I use both Metatag and SEO Meta Tags in this website, as the second module offers a very convenient and easy way to work with meta tags in Views (especially when it comes to Open Graph) and I have found in practice that the simultaneous operation of SEO Meta Tags and Metatag Views causes problems with duplicate meta tags that I avoid by setting up metadata in Views only through SEO Meta Tags.

I could deactivate SEO Meta Tags and activate Metatag Views but I have many available publications from the last three years and I have to write over them as meta tags again if I deactivate SEO Meta Tags.

I will look for information on how to use AJAX for the filters or View arguments - this seems like a more accessible solution to me.

Thank you very much.

Thanks again. The advice helped me with a little extra help from Chat GPT:

Other
Use AJAX: Yes

I find the Better Exposed Filters module is a must have for exposed filters.

Thanks, I also use Better Exposed Filters and find it extremely useful.

I would like to note as a help for other users in the forum who might be interested in the problem that Use AJAX: Yes solves the issue from the users' point of view, they only see the URL of the main page, but not for search engines - the URLs for each filter value are still accessible and the search engine finds them by links to filtered pages in the filter, and this is counted as duplicate titles and meta descriptions.

I found several solutions to this problem, but the easiest and most effective for me is to prohibit indexing of filtered URLs via robots.txt - using the relevant part of the URL to the search query to the product group and * as a wildcard for field values.

There is a way to override the title based on contextual filters, but I guess not for exposed filters.

Perhaps you could do a hook_views_pre_render() implementation and change the title based on the filter values there?