Mobile app version of vmapp.org
Login or Join
Annie201

: What should I use for a canonical URL for a search page that has a few search options? I read this post here: What is a best canonical URL for a search result page? and I have search page

@Annie201

Posted in: #CanonicalUrl #Search #Seo

I read this post here: What is a best canonical URL for a search result page?

and I have search page which can set more than one item like this:

example.com/search/index.php?keywords=fruits_bananas_apples

Which would be better for a canonical URL:

example.com/search/index.php

or

example.com/search/index.php?keywords=fruits_bananas_apples

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Annie201

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sherry384

In general it might be a good idea to block crawling of search result pages, but there are cases where it can makes sense to allow crawling.

For example, if your search is the only or the primary way to navigate the site, and especially if you offer filters (or search operators) with pre-defined search terms. So instead of having a separate /category/ namespace (e.g., /category/movies), some sites use the search function for this: /search/category:movies.

And besides that: Even if you disallow crawling of search result pages, it can still make sense to provide the canonical link type for these pages (all kinds of tools might use it, e.g., for bookmarking).

So here’s an answer to the original question:

It would be wrong to use example.com/search/index.php as canonical URL for example.com/search/index.php?keywords=fruits_bananas_apples.

RFC 6596 makes clear that the canonical URL


[…] MUST identify content that is either duplicative or a superset of the content […]


As /search/index.php does (most likely) not contain or include the content from /search/index.php?keywords=fruits_bananas_apples, it’s not allowed to be specified as canonical URL.

A case where it would be appropriate for a search result to use the canonical link relation (just as an example to give you an idea, probably not worth to implement this one): Assuming that the order of the search terms does not matter, you could decide to use the URL with the search terms in alphabetical order as canonical URL, e.g.,

/search/index.php?keywords=apples_bananas_fruits


for URLs like

/search/index.php?keywords=apples_fruits_bananas
/search/index.php?keywords=fruits_bananas_apples

10% popularity Vote Up Vote Down


 

@Annie201

Search pages should be disallowed from crawling with the robots.txt

see John Mullers comment on What is a best canonical URL for a search result page?

thanks dan!

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme