Answers.Body: <p>Like stated in the <a href="https://github.com/nystudio107/seomatic/wiki/02.-Rendering-your-SEO-Meta-tags" rel="nofollow noreferrer">docs</a> you can overwrite the default template with your own one and implement your logic however you like. So you can check for certain condition if you want to use the default SEOmatic inputs or your custom one. You can create a custom template based on this file <a href="https://github.com/nystudio107/seomatic/blob/master/templates/_seo_meta.twig" rel="nofollow noreferrer">meta template</a> and change <a href="https://github.com/nystudio107/seomatic/blob/master/templates/_seo_meta.twig#L19" rel="nofollow noreferrer">line 19</a>
  from </p>
  
  <pre><code>{% if seomaticMeta.canonicalUrl |length %}
  &lt;link rel="canonical" href="{{ seomaticMeta.canonicalUrl }}" /&gt;
  {% endif %}
  </code></pre>
  
  <p>to something like </p>
  
  <pre><code>{% if entry.useCustomData is defined and entry.useCustomData == true%}
     &lt;link rel="canonical" href="{{ whatever }}" /&gt;
  {% else %} 
      {% if seomaticMeta.canonicalUrl |length %}
          &lt;link rel="canonical" href="{{ seomaticMeta.canonicalUrl }}" /&gt;
      {% endif %}
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-05T14:27:48.973Z
Answers.Text: Thanks very much for the answer! 
  
  I've also been able to find more information in the docs about overriding the default data, and have created this in my layout template. 
  
  `{% if entry.canonicalUrl|length > 0 %}  
  {% set seomaticMeta = seomaticMeta | merge({'canonicalUrl': entry.canonicalUrl}) %}  
  {% endif %}  
     
  {% hook 'seomaticRender' %}`
Answers.UserDisplayName: David Ball
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-05T15:08:12.093Z
Answers.Text: Yes that is a really good approach as well, glad you found a solution
Answers.UserDisplayName: Robin Schambach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-05T14:13:54.477Z
Answers.LastActivityDate: 2018-01-05T14:13:54.477Z
Answers.UserDisplayName: Robin Schambach
Answers.Body: <p>Robin's answer above is valid, but I have managed to create an override in my main _layout template like this:</p>
  
  <pre><code>{% if entry.canonicalUrl|length &gt; 0 %}
      {% set seomaticMeta = seomaticMeta | merge({'canonicalUrl': entry.canonicalUrl}) %}
  {% endif %}
  
  {% hook 'seomaticRender' %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-07T18:44:34.157Z
Answers.Text: I prefer doing it this way
Answers.UserDisplayName: andrew.welch
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-05T14:33:39.280Z
Answers.LastActivityDate: 2018-01-05T14:33:39.280Z
Answers.UserDisplayName: David Ball
Body: <p>SEOmatic puts a canonical on every page. But some pages I need to be able to add a custom canonical, but not sure how to overide SEOmatic's otherwise there will be two. </p>
  
Tags: <seo><plugin-seomatic>
Title: Can I add a custom canonical URL to a page if also using SEOmatic?
ThreadText: # Can I add a custom canonical URL to a page if also using SEOmatic?
  
  (Asked by: username_0 on 2018-01-05)
  
  SEOmatic puts a canonical on every page. But some pages I need to be able to add a custom canonical, but not sure how to overide SEOmatic's otherwise there will be two.
  
  **Tags:** seo, plugin-seomatic
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-01-05. Score: 1 | Accepted answer
  
  Like stated in the [docs](https://github.com/nystudio107/seomatic/wiki/02.-Rendering-your-SEO-Meta-tags) you can overwrite the default template with your own one and implement your logic however you like. So you can check for certain condition if you want to use the default SEOmatic inputs or your custom one. You can create a custom template based on this file [meta template](https://github.com/nystudio107/seomatic/blob/master/templates/_seo_meta.twig) and change [line 19](https://github.com/nystudio107/seomatic/blob/master/templates/_seo_meta.twig#L19)
  from
  
  ```
  {% if seomaticMeta.canonicalUrl |length %}
  <link rel="canonical" href="{{ seomaticMeta.canonicalUrl }}" />
  {% endif %}
  
  ```
  
  to something like
  
  ```
  {% if entry.useCustomData is defined and entry.useCustomData == true%}
     <link rel="canonical" href="{{ whatever }}" />
  {% else %} 
      {% if seomaticMeta.canonicalUrl |length %}
          <link rel="canonical" href="{{ seomaticMeta.canonicalUrl }}" />
      {% endif %}
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks very much for the answer!   I've also been able to find more information in the docs about overriding the default data, and have created this in my layout template.   `{% if entry.canonicalUrl|length > 0 %}   {% set seomaticMeta = seomaticMeta | merge({'canonicalUrl': entry.canonicalUrl}) %}   {% endif %}       {% hook 'seomaticRender' %}`  
  > **username_1**: Yes that is a really good approach as well, glad you found a solution  
  
  ---
  
  ### Answer by username_0 on 2018-01-05. Score: 3
  
  username_1's answer above is valid, but I have managed to create an override in my main \_layout template like this:
  
  ```
  {% if entry.canonicalUrl|length > 0 %}
      {% set seomaticMeta = seomaticMeta | merge({'canonicalUrl': entry.canonicalUrl}) %}
  {% endif %}
  
  {% hook 'seomaticRender' %}
  
  ```
  
  > **Comments:**
  > **username_2**: I prefer doing it this way  
  
  ---
  
  