Search code examples
seostacksearch-enginetoken

Canonical Link Element for Dynamic Pages ( rel="canonical")


I have a stack system that passes page tokens in the URL. As well my pages are dynamically created content so I have one php page to access the content with parameters.

index.php?grade=7&page=astronomy&pageno=2&token=foo1

I understand the search indexing goal to be The goal is to have only one link per unique set of data on your website.

Bing has a way to specify specific parameters to ignore. Google it seems uses rel="canonical" but is it possible to use this to tell Google to ignore the token parameter? My URL (without tokens) can be anything like:

index.php?grade=5&page=astronomy&pageno=2
index.php?grade=6&page=math&pageno=1
index.php?grade=7&page=chemistry&page2=combustion&pageno=4

If there is not a solution for Google... Other possible solutions:

If I provide a site map for each base page, I can supply base URLs but any crawing of that page's links will crate tokens on resulting pages. Plus I would have to constantly recreate the site map to cover new pages (e.g. 25 posts per page, post 26 is on page 2).

One idea I've had is to identify bots on page load (I do this already) and disable all tokens for bots. Since (I'm presuming) bots don't use session data between pages anyway, the back buttons and editing features are useless. Is it feasible (or is it crazy) to write custom code for bots?

Thanks for your thoughts.


Solution

  • You can use the Google Webmaster Tools to tell Google to ignore certain URL parameters.

    This is covered on the Google Webmaster Help page.