{
  "id": 12051880,
  "title": "Multilingual Ghost CMS Blog: 7. Adding hreflang",
  "url": "https://urgent.news/2026/10/05/multilingual-ghost-cms-blog-7-adding-hreflang",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-05T02:03:59.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sanghunkang/multilingual-ghost-cms-blog-7-adding-hreflang-2dl9"
  },
  "original_language": "en",
  "account": "Multilingual Ghost CMS blog: Adding hreflang links\n\nThe English and Korean versions of this blog have different URLs: https://sanghunkang.com/ for English and https://sanghunkang.com/ko/ for Korean. However, search engines had no way of knowing that these pages were language-specific. The solution is to use the hreflang attribute to indicate the relationship between each language URL.\n\nIn the 0.0.7 release, hreflang was added to the English and Korean home pages. The home page URLs are:\n- English: https://sanghunkang.com/\n- Korean: https://sanghunkang.com/ko/\n\nTo add the hreflang attribute to both pages, I included three links in the <head> section of each page:\n```html\n<link rel=\"alternate\" hreflang=\"en\" href=\"https://sanghunkang.com/\">\n<link rel=\"alternate\" hreflang=\"ko\" href=\"https://sanghunkang.com/ko/\">\n<link rel=\"alternate\" hreflang=\"x-default\" href=\"https://sanghunkang.com/\">\n```\nThe \"x-default\" language indicates the default page to use when the user's language is not clearly matched.\n\nAt first, I attempted to check if the current page was the home page using the `{{#is home}}` condition in default.hbs, but Ghost treats `/ko/` as the site home because it's the first page of a Collection created with routes.yaml. This caused the hreflang attribute to only appear on the English home page.\n\nTo fix this issue, I modified index-en.hbs and index-ko.hbs to output the hreflang block from the respective language home pages. Both templates now pass the same set of URLs, ensuring that the hreflang attribute appears on both the English and Korean home pages.",
  "summary": "The English home is served at / , and the Korean home at /ko/ , but search engines had no information indicating that the two pages were versions in different languages. Providing users with a Language selector and explaining multilingual relationships to search engines are separate issues. For search engines, you need to use hreflang to indicate the relationship between each language URL. In…",
  "key_points": [
    "hreflang attribute added to English and Korean home pages",
    "hreflang links indicate language-specific URLs relationship",
    "x-default language specifies default page for unmatched language"
  ],
  "editors_take": "Adding hreflang links enables search engines to identify language-specific pages, improving discoverability for the Korean version of the blog, previously undifferentiated from the English version by search engines.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}