# How to Publish or Unpublish Your Website to a Custom Domain

**What it does:** This feature lets you make your website available on your own custom domain name (like `yoursite.com`) or subdomain (like `shop.yoursite.com`).

**Before you start:** 
- Log in to your WordPress admin panel at `yourwebsite.com/wp-admin`
- Make sure you have access to your domain's DNS settings (usually through your domain registrar like GoDaddy, Namecheap, etc.)

## Steps to Publish Your Site to a Custom Domain

1) Click on **MTV Product Configuration** in the left menu
2) Check the box next to **Ready to Publish**
3) Find the **Addon Domain** field and type your custom domain or subdomain name
   - For a full domain: `mystore.com`
   - For a subdomain: `shop.mystore.com`
4) Click the **Save Changes** button at the bottom
5) The system will process your request on the server (this happens immediately)
6) **Important:** Once processed, you'll see a notice at the top of the page with DNS instructions
7) Go to your domain registrar and update your DNS records as shown in the notice
   - You'll need to add an A record or CNAME record
   - Copy the exact values from the notice
8) The system checks your DNS configuration **every 5 minutes** automatically
9) You'll receive an **email notification** when DNS is detected and setup is complete
10) You'll also see **admin notices** at the top of your WordPress dashboard showing progress
11) Visit your custom domain in a web browser to see your site live

## Steps to Unpublish Your Site from a Custom Domain

1) Click on **MTV Product Configuration** in the left menu
2) Uncheck the box next to **Ready to Publish**
3) Click the **Save Changes** button at the bottom
4) Wait 2-3 minutes for the system to remove your site from the custom domain
5) You'll receive an **email notification** when the unpublish is complete
6) You'll also see an **admin notice** at the top of your WordPress dashboard
7) Your site will no longer be accessible from the custom domain

## How You'll Be Notified

**Email Notifications:**
- You'll receive an email at your WordPress admin email address
- Success emails confirm your domain is live or unpublished
- Failure emails explain what went wrong with detailed error information

**Admin Notices (appear at the top of WordPress admin pages):**
- **Blue "Pending" notice:** Your request is queued and will be processed soon
- **Green "Server Configuration Complete" notice:** Server setup is done, now waiting for your DNS configuration
- **Yellow "Waiting for DNS Configuration" notice:** The system is checking your DNS every 5 minutes
- **Green "Domain Action Completed" notice:** Everything is done and your domain is live!
- **Red "Failed" notice:** Something went wrong - check the error message

**DNS Checking Process:**
- After you save your settings, the server processes your request immediately
- Once server setup is complete, you'll see the DNS instructions notice
- The system automatically checks your DNS configuration **every 5 minutes**
- When your DNS is detected pointing to our servers, you'll get a completion notice
- This process can take anywhere from 5 minutes to 48 hours depending on DNS propagation

**Tip:** Always complete the DNS setup step before expecting your domain to work. Even if the system sets everything up correctly, your domain won't work until DNS records are pointing to our servers.

**Common mistake:** Don't forget to click Save Changes after checking the Ready to Publish box and entering your domain. The system won't start until you save.

**Done:** That's it — you're done!

## What Happens Behind the Scenes

When you publish:
- **Immediately:** The system creates a new addon domain on the server
- **Immediately:** Sets up all necessary files and folders
- **Immediately:** Shows you a notice with DNS instructions
- **You do this:** Configure DNS records at your domain registrar
- **Every 5 minutes:** The system checks if your DNS is pointing to our servers
- **When DNS is detected:** You receive an email and admin notice that your site is live

When you unpublish:
- **Immediately:** The system removes the addon domain from the server
- **Immediately:** Cleans up DNS records
- **Immediately:** Sends you a confirmation email and admin notice

## Need Help?

If you receive a failure email or red admin notice, it will include details about what went wrong. 

**Common issues and solutions:**

- **Domain name already in use:** The domain is already configured on another site. Contact support to resolve.
- **Domain not pointing to our servers:** You need to update your DNS records first (see step 6 above).
- **Invalid domain name format:** Make sure you typed the domain correctly without `http://` or `www.` prefix.
- **DNS not propagated yet:** DNS changes can take up to 24-48 hours to work everywhere. Be patient.

**Getting DNS Information:**
- The admin notice after saving will show you exactly what DNS records to create
- Write down or screenshot the DNS information before leaving the page
- If you missed it, contact support for the correct DNS settings

Contact your administrator or support team with the error message from the email or admin notice, and they'll help you resolve it quickly.
