Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to add <meta rel="canonical"> tags to site pages #5818

Merged
merged 3 commits into from Oct 11, 2017

Conversation

mlocati
Copy link
Contributor

@mlocati mlocati commented Aug 8, 2017

Currently, a single page may have multiple URLs:

  • www.example.com/test
  • www.example.com/index.php/test
  • www.example.com/?cID=123
  • www.example.com/index.php?cID=123

That's not good for search engines: they see duplicated contents at different URLs.
Let's tell them that all these URLs are for the same page (www.example.com/test)

@KorvinSzanto
Copy link
Member

This looks good to me, @aembler what do you think?

@KorvinSzanto
Copy link
Member

@mlocati resolve conflicts and I think this is good to merge.

# Conflicts:
#	concrete/config/site.php
@mlocati
Copy link
Contributor Author

mlocati commented Oct 3, 2017

resolve conflicts

Done

@aembler aembler merged commit 12791f4 into concretecms:develop Oct 11, 2017
@mlocati mlocati deleted the seo-canonical-url branch October 11, 2017 18:33
@biplobice
Copy link
Contributor

@mlocati Thank you for this feature. We're facing a different issue.
For example, we have the following URL.
https://example.com/action/param
But when there is a reference link from facebook/twitter/google it adds some parameters like-
https://example.com/action/param?utm_content=buffer539cd3&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

So, the canonical URL also get the same value. Our client wants to remove this get parameters from the canonical URL. I know you already have added an option excluded_querystring_parameters. But I think it would be a long list for our client. What could be the best solution for it then?

@mlocati
Copy link
Contributor Author

mlocati commented Mar 4, 2019

The only solution I see is to add utm_content, utm_medium, utm_source, utm_campaign and so on to the value of the seo.canonical_tag.excluded_querystring_parameters site configuration key...

@biplobice
Copy link
Contributor

Thank you.

@hissy
Copy link
Contributor

hissy commented Mar 19, 2019

The only solution I see is to add utm_content, utm_medium, utm_source, utm_campaign and so on to the value of the seo.canonical_tag.excluded_querystring_parameters site configuration key...

Thank you @mlocati , but if so, we should add some get parameters from popular search engines and social networking sites into the default config file, didn't it?

@mlocati
Copy link
Contributor Author

mlocati commented Mar 19, 2019

@hissy what about creating a file located at /application/config/site.php with this contents?

<?php

return [
    'sites' => [
        'default' => [
            'seo' => [
                'canonical_tag' => [
                    'excluded_querystring_parameters' => [
                        'cID',
                        'ccm_token',
                        'utm_content',
                        'utm_medium',
                        'utm_source',
                        'utm_campaign',
                    ],
                ],
            ],
        ],
    ],
];

@hissy
Copy link
Contributor

hissy commented Mar 19, 2019

@mlocati Yeah, I can do that because I know about concrete5 config system well, but most of the beginners are not.

@mlocati
Copy link
Contributor Author

mlocati commented Mar 19, 2019

I agree.
I'd collect the various querystring parameters defined by the different search engines/ads systems (Google, Bing, Facebook Pixel, ...) and add them to the default list.

@hissy
Copy link
Contributor

hissy commented Jun 21, 2019

We should ignore query and search_paths too. Search block uses these parameters, so it will be attached to the canonical URL on the search result. It's annoying.

@hissy
Copy link
Contributor

hissy commented Nov 19, 2019

I'd collect the various querystring parameters defined by the different search engines/ads systems (Google, Bing, Facebook Pixel, ...) and add them to the default list.

@mlocati Any updates on this issue? Should I create a new open issue about this?

@mlocati
Copy link
Contributor Author

mlocati commented Nov 19, 2019

Should I create a new open issue about this?

I think it's a good idea: comments in merged pull requests aren't a great place to write about new issues, since they are somehow "hidden"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants