diff --git a/typo3/sysext/seo/Classes/Canonical/CanonicalGenerator.php b/typo3/sysext/seo/Classes/Canonical/CanonicalGenerator.php
index 9eb0cb190f3887e80a837e41ad661ea899ba59ce..27f5600565a0491cea51a18db975803ce6235ad3 100644
--- a/typo3/sysext/seo/Classes/Canonical/CanonicalGenerator.php
+++ b/typo3/sysext/seo/Classes/Canonical/CanonicalGenerator.php
@@ -68,12 +68,12 @@ class CanonicalGenerator
         }
 
         if (empty($href)) {
-            // 1) Check if page show content from other page
-            $href = $this->checkContentFromPid();
+            // 1) Check if page has canonical URL set
+            $href = $this->checkForCanonicalLink();
         }
         if (empty($href)) {
-            // 2) Check if page has canonical URL set
-            $href = $this->checkForCanonicalLink();
+            // 2) Check if page show content from other page
+            $href = $this->checkContentFromPid();
         }
         if (empty($href)) {
             // 3) Fallback, create canonical URL
diff --git a/typo3/sysext/seo/Tests/Functional/Canonical/CanonicalGeneratorTest.php b/typo3/sysext/seo/Tests/Functional/Canonical/CanonicalGeneratorTest.php
index 3e73b55a40e8e6bbab7a954d1925bf09e79de003..663ebf1de6747a89b42786176019a0574674b01f 100644
--- a/typo3/sysext/seo/Tests/Functional/Canonical/CanonicalGeneratorTest.php
+++ b/typo3/sysext/seo/Tests/Functional/Canonical/CanonicalGeneratorTest.php
@@ -125,7 +125,7 @@ class CanonicalGeneratorTest extends FunctionalTestCase
             ],
             'uid: 3 with canonical_link AND content_from_pid = 2' => [
                 'http://localhost/dummy-1-3',
-                '<link rel="canonical" href="http://localhost/dummy-1-2"/>' . chr(10),
+                '<link rel="canonical" href="http://localhost/dummy-1-3"/>' . chr(10),
             ],
             'uid: 4 without canonical_link AND content_from_pid = 2' => [
                 'http://localhost/dummy-1-4',