Incorrect Site Address (URL) – WordPress Daily Routine Incorrect Site Address (URL)


Categories

Incorrect Site Address (URL)

Website redirects to the wrong domain or subfolder due to misconfigured site URL.

Incorrect Site Address (URL)

Key Points: WordPress URL or Site URL is wrong, causing redirects to old domains, subfolders, or localhost.

You open your site and end up in a parallel universe — maybe an old domain, maybe localhost. WordPress is trying to load from the wrong address, and your browser is just playing along.

🔍 Why It Happens

  • Moved WordPress to a new domain but didn’t update URLs
  • Site URL changed manually or by a plugin
  • Database import from another site without replacing URLs

🛠️ How to Fix It

  1. Add correct values to wp-config.php:
    define('WP_HOME','https://yourdomain.com');
     define('WP_SITEURL','https://yourdomain.com');
  2. Then go to Settings → General and double-check
  3. If locked out, run a database search & replace using WP-CLI or a plugin

💡 Pro Tip

Never hardcode URLs in theme files. Use WordPress functions like home_url() or site_url() for portability.