Answers.Body: <p>Both SEOmatic for Craft 2 and SEOmatic for Craft 3 have built-in functions to give you these URLs. I'm not sure which you are using so...</p>
  
  <p>For Craft 2: <a href="https://github.com/nystudio107/seomatic/wiki/15.-Utility-Filters-&amp;-Functions#getlocalizedurls" rel="nofollow noreferrer">https://github.com/nystudio107/seomatic/wiki/15.-Utility-Filters-&amp;-Functions#getlocalizedurls</a></p>
  
  <p>For Craft 3: <a href="https://github.com/nystudio107/craft-seomatic#helper-functions-seomatichelper" rel="nofollow noreferrer">https://github.com/nystudio107/craft-seomatic#helper-functions-seomatichelper</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-25T18:38:20.213Z
Answers.LastActivityDate: 2018-04-25T18:38:20.213Z
Answers.UserDisplayName: andrew.welch
Body: <p>I'm working on a multilingual website (Spanish and English, default is Spanish). I'm using the SEOmatic plugin, and I see that it generates this code:</p>
  
  <pre><code>&lt;link rel="alternate" hreflang="es" href="http://localhost:8888/cmml/contacto" /&gt;
  &lt;link rel="alternate" hreflang="en" href="http://localhost:8888/cmml/en/contact-us" /&gt;
  </code></pre>
  
  <p>And I'm wondering if, instead of linking to the home page in an alternate language is there a way to link to the same resource in the alternate language?</p>
  
  <p>Is there an <em>easy</em> way to achieve this? Thanks folks.</p>
  
Tags: <localization><plugin-seomatic>
Title: Dynamic link to same entry but in alternate language
ThreadText: # Dynamic link to same entry but in alternate language
  
  (Asked by: username_0 on 2018-04-25)
  
  I'm working on a multilingual website (Spanish and English, default is Spanish). I'm using the SEOmatic plugin, and I see that it generates this code:
  
  ```
  <link rel="alternate" hreflang="es" href="http://localhost:8888/cmml/contacto" />
  <link rel="alternate" hreflang="en" href="http://localhost:8888/cmml/en/contact-us" />
  
  ```
  
  And I'm wondering if, instead of linking to the home page in an alternate language is there a way to link to the same resource in the alternate language?
  
  Is there an *easy* way to achieve this? Thanks folks.
  
  **Tags:** localization, plugin-seomatic
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-04-25. Score: 2 | Accepted answer
  
  Both SEOmatic for Craft 2 and SEOmatic for Craft 3 have built-in functions to give you these URLs. I'm not sure which you are using so...
  
  For Craft 2: <https://github.com/nystudio107/seomatic/wiki/15.-Utility-Filters-&-Functions#getlocalizedurls>
  
  For Craft 3: <https://github.com/nystudio107/craft-seomatic#helper-functions-seomatichelper>
  
  
  ---
  
  