> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackshift.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect a custom domain to WordPress

> Understand how StackShift routing and WordPress site URLs interact before and after first boot.

<Tip>
  **Live.** This area is documented as current, user-reliable behavior.
</Tip>

## Goal

Attach the right domain without leaving WordPress and StackShift out of sync.

## Prerequisites

* A deployed or planned WordPress stack

## Workflow

<Steps>
  <Step>
    Decide on the public domain as early as possible.
  </Step>

  <Step>
    Attach or configure the domain in StackShift.
  </Step>

  <Step>
    Verify the public site and `/wp-admin` on the final hostname.
  </Step>
</Steps>

## Why WordPress is different from a plain app

WordPress stores its own site URL and home URL in the database and bakes them into links, redirects, and asset paths. So a custom domain is not only a routing change at the edge — the WordPress site URL has to match the hostname it is actually served on.

## Attaching the domain

* Decide the public domain as early as possible — ideally before first boot.
* Attach the domain to the WordPress project in StackShift so routing and TLS are issued for it.
* Verify both the public site and /wp-admin on the final hostname.

## Keeping URLs in sync

If the site was first deployed on a generated hostname, resync the WordPress URLs after attaching the domain — a redeploy or the update site URL action rewrites the stored URLs. Skipping this is the usual cause of redirect loops, mixed-content warnings, or an admin that bounces back to the old hostname.

## Expected result

<Check>
  Routing and WordPress site URLs line up with fewer surprises after launch.
</Check>

## Common failures

<Warning>
  * The WordPress site URL still points at the generated hostname, causing redirect loops or mixed content.
  * The domain is routed at the edge but WordPress was never resynced to it.
</Warning>

## Related guides

<CardGroup cols={2}>
  <Card title="Deploy WordPress on StackShift" href="/wordpress/deploy-wordpress-on-stackshift">
    Launch single-site WordPress as a template-backed stack with bundled MariaDB and persistent storage.
  </Card>

  <Card title="WordPress Control Surface" href="/wordpress/wordpress-control-surface">
    A first-class operational surface for direct WordPress projects: overview, narrow safe actions, diagnostics, and recent history.
  </Card>
</CardGroup>
