How to fix that,
Hi @mzainmalik033 ,
The search query parameter pages do not have a head section or are generated dynamically through filters and do not exist as separate pages at the backend, so, we can’t add the “noindex” tag to those pages.
In this case, you can consider blocking the search query parameter pages from being indexed using the robots.txt file. The robots.txt file instructs search engine crawlers on which pages of a website to crawl and index.
To block the search query parameter pages, you can add the following code to the robots.txt file:
User-agent: * Disallow: /*?* (here you can add the search parameter and also test the URL coming in the issues that it should be blocked)
This code instructs all search engine crawlers not to index any page that contains a question mark (?) in the URL, which is a common way to indicate a search query parameter.
However, it’s important to note that using the robots.txt file to block pages from being indexed does not guarantee that they won’t appear in search results. Some search engines may still include these pages in search results even if they are blocked in robots.txt. Therefore, implementing other measures, such as the canonical tag on the search results pages, is also recommended (if applicable).
Regards,
Hassan
