How to Fix WordPress Redirecting to Temporary Domain After Connecting Main Domain
Written by Jogen Rabha
Jogen Rabha

Jogen Rabha is the Founder and CEO of 24siteshop Private Limited, with over 8 years of hands-on experience in website development. He specializes in building performance-driven WordPress websites for businesses, startups, NGOs, and service-based companies. Over the years, Jogen has worked on hundreds of real client projects, focusing on clean design, user experience, speed optimization, and SEO-friendly structures. His approach is practical and result-oriented — every website is built with a clear business goal, whether it’s lead generation, online presence, or digital growth. Jogen believes in transparency, real proof of work, and long-term client support rather than shortcuts or false promises. Through 24siteshop, he continues to help businesses establish a strong online identity using modern web technologies, proven workflows, and real-world development experience.

Read more about the author

If your WordPress website is still opening the temporary domain even after connecting the main domain, don’t worry — this usually happens because WordPress is still using the old site URL.

Here’s the quick fix:

Step 1: Check Database / WP Options

Go to your database or WordPress settings and check these two values:

  • siteurl
  • home

Make sure both are using the correct main domain with HTTPS.

Example:

https://yourdomain.com

⚠️ Important:

  • both should be same
  • use https
  • do not keep old temp domain
  • do not use http

Step 2: Force Main Domain in wp-config.php

Now open your wp-config.php file.

Add these 2 lines just above:

/* That's all, stop editing! Happy publishing. */

Add this:

define('WP_HOME', 'https://yourdomain.com');
define('WP_SITEURL', 'https://yourdomain.com');

This forces WordPress to always open the correct live domain.

Step 3: Save and Clear Cache

After that:

  • clear Hostinger cache
  • clear WordPress cache plugin
  • open site in incognito

Final Fix

In most cases, this issue gets fixed by just:

  • updating siteurl
  • updating home
  • adding WP_HOME
  • adding WP_SITEURL

That’s it.

If your website is still redirecting after this, then the old temporary domain is likely stored somewhere else in the database or cache.

Leave a Comment

Your email address will not be published. Required fields are marked *

Total Visitors: