Details
-
Type:
Bug
-
Status: Done/Fixed
-
Priority:
Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.13
-
Fix Version/s: 4.7.18
-
Component/s: WordPress Integration
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Contributed Code
-
Verified?:No
Description
The canonical link element helps search engines and social media platforms know which URLs are minor variations of each other as opposed to distinct pages. WordPress puts together a canonical URL using the post's permalink.
When using basepage URLs (as opposed to shortcodes), all CiviCRM pages use the same basepage, and WordPress includes the same canonical URL. Besides being terrible for SEO (event 2 is considered to be the same page as contribution page 1), it also means that sharing basepage-based CiviCRM pages on social media is ugly.
This is a really big problem for PCPs, since there is no shortcode support for them (and anyway, you might not have the time to manually set up pages with shortcodes for each personal campaign page).
WordPress 4.6.0 added a new filter for setting the canonical URL, and the popular Yoast WordPress SEO plugin has a filter for doing the same. We should post the canonical URLs to include all the parameters.
Maybe someday we'll establish a firm list of params that might be expected on a frontend URL, and we could also establish a canonical order of params. This would help say, for example, that
http://example.org/civicrm/?page=CiviCRM&q=civicrm/event/register&reset=1&id=1&cid=0
is based upon the canonical URL
http://example.org/civicrm/?page=CiviCRM&q=civicrm/event/register&id=1&reset=1
But until then, we can at the very least provide the whole query string and set the official basepage.