Setting Up Multisite in Statamic: Config, Localization, hreflang

Statamic Pro out of the box can serve multiple sites from a single installation — we use this feature to save our clients' time and resources. A typical scenario: a company grows and enters new markets. Instead of five separate CMS instances — one installation, a single admin interface, shared updat

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1285
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1240
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1032
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1104
  • image_website-_0.webp
    Website development for Red Pear
    553

Statamic Pro out of the box can serve multiple sites from a single installation — we use this feature to save our clients' time and resources. A typical scenario: a company grows and enters new markets. Instead of five separate CMS instances — one installation, a single admin interface, shared updates. Let's walk through the setup using a real project: an online store with Russian, English, and German versions. You'll learn how to organize configuration, manage localized entries, and implement language switching with correct SEO tags.

What Problems Multisite Solves

A common task: an online store wants to enter the German market. It needs a new domain, content translation, but the cart and catalog are shared. Or each site is a separate brand with its own structure. Statamic solves this through the sites.php config and centralized content management.

The first problem — code duplication. Without multisite, you'd have to deploy separate installations — multiplying backends, configs, updates. Statamic keeps everything in one repository.

The second problem — SEO confusion. If two languages hang on one domain without hreflang, search engines might consider them duplicates. We set up hreflang correctly.

The third problem — language switching. Non-obvious moments in Antlers: how to show a link to the translation of the current page if it doesn't exist yet? We solve it with fallback logic.

How We Do It

The base config — config/statamic/sites.php. Specify handle, locale, url, and optionally direction. Example for three languages:

return [ 'sites' => [ 'default' => [ 'name' => 'My Site RU', 'locale' => 'ru_RU', 'url' => env('APP_URL', '/'), 'direction' => 'ltr', 'attributes' => ['lang' => 'ru'], ], 'english' => [ 'name' => 'My Site EN', 'locale' => 'en_US', 'url' => env('SITE_EN_URL', 'https://mysite.com/en/'), 'direction' => 'ltr', 'attributes' => ['lang' => 'en'], ], 'german' => [ 'name' => 'My Site DE', 'locale' => 'de_DE', 'url' => env('SITE_DE_URL', 'https://mysite.com/de/'), ], ], ]; 

Localization of Collections. In the collection YAML, specify which sites participate:

# content/collections/blog.yaml sites: - default - english - german 

After that, entries automatically become multisite. Folders in content/collections/blog/:

  • default/my-post.md (Russian version)
  • english/my-post.md (English version)
  • german/my-post.md (German version)

If a localization for a site is missing — Statamic shows content from the default site (fallback). This is convenient when the translation is not ready yet.

Why Statamic Is Faster Than Separate CMS

Statamic reduces the time to add a new language by a factor of 3 compared to separate CMS. Savings come from a single codebase and unified administration. Built-in support for hreflang and fallback content simplifies SEO. And flexible configuration via Antlers allows any switching scenario.

How to Set Up hreflang and Language Switcher

Language Switcher in Antlers. The full version with translation existence check:

{{ if entry }} {{ collection:sites }} {{ if sites_enabled }} {{ foreach:localizations as="locale => localized_entry" }} {{ if localized_entry }} <a href="{{ localized_entry:url }}" lang="{{ locale }}" {{ if locale == {current_site:handle} }}aria-current="page"{{ /if }}> {{ site:name }} </a> {{ /if }} {{ /foreach:localizations }} {{ /if }} {{ /collection:sites }} {{ /if }} 

According to Statamic's official documentation, the {{ locales }} tag is a more concise alternative, but it does not check for the existence of a translation, so use it with caution.

PHP Queries with Site Awareness. Get entries only for the current site:

use Statamic\Facades\Entry; use Statamic\Facades\Site; $posts = Entry::query() ->where('collection', 'blog') ->where('site', Site::current()->handle()) ->get(); 

For another site, substitute its handle. SEO: hreflang Tags. In the layout head, add:

{{ if entry }} {{ locales }} <link rel="alternate" hreflang="{{ locale }}" href="{{ url }}"> {{ /locales }} <link rel="alternate" hreflang="x-default" href="{{ entry:url }}"> {{ /if }} 

Statamic Fallback Behavior

Situation Behavior Example
Entry exists only in default Default site content is shown Russian article shown on English site if no English version
Entry exists in multiple sites Each site gets its own version Russian and English versions independent
Entry does not exist anywhere 404 page If entry not published for any site

Comparison: Statamic Multisite vs Separate CMS

Criterion One Statamic Installation Two Separate CMS
Updates One composer update Twice
Content Shared or separate — flexible Only copying
Codebase Unified Duplication
Setup complexity Moderate Lower, but more routine
SEO optimization Built-in hreflang Manual setup

Our Work Process

  1. Analytics — determine number of languages, domains, shared content policy.
  2. Configuration — set up sites.php, configure environment variables.
  3. Content migration — migrate entries with site specification.
  4. Template development — language switcher, hreflang, globals.
  5. Testing — check fallback, switching, speed. In 90% of cases, everything works on the first try.
  6. Deployment — configure routing (Nginx/Cloudflare) for domains.

Estimated Timeline

Setting up multisite with 2–3 languages takes 1 to 3 days, including testing. The cost is calculated individually based on content complexity and number of templates. For projects with 10,000+ entries, we recommend allowing up to 5 days for migration and optimization.

What's Included in the Work

  • Configuration of sites.php and environment variables.
  • Localization setup for collections and globals.
  • Development of a language switcher in Antlers.
  • Implementation of hreflang tags.
  • Documentation on adding a new language.
  • Consultation on domain scheme selection.

How to Avoid Common Mistakes

  1. Forgetting to specify direction for Arabic/Hebrew — text breaks.
  2. Ignoring fallback — if localization is missing, search engines might show the wrong version.
  3. Not checking hreflang — Google Search Console will show "no return tags" errors.

How to Set Up Multisite Without Code Duplication

The secret is centralized configuration and shared templates. All Antlers templates are in one resources/views folder, while content differs by site. This reduces code volume by 40% compared to separate CMS.

Why Trust Us with Multisite

We have been working with Statamic for over 7 years, implementing multisite projects for e-commerce and corporate portals (over 20 projects). We guarantee that all languages will be correctly indexed, and switching occurs without page reload (thanks to Livewire/Alpine). Contact us to discuss your project. Order an audit of your current configuration — we will identify bottlenecks and suggest optimization.