How to change WordPress site URL (Site Address)

When managing a WordPress website, you might find yourself needing to change the site URL or address. This could be due to a domain change, moving to a secure HTTPS protocol, or other reasons. Changing the WordPress URL is not overly complicated, but it needs to be done carefully to prevent any downtime or errors. In this guide, we will walk through the steps to safely change your WordPress site URL, along with tips for troubleshooting common issues that might arise during or after the change.

Step-by-Step Guide to Changing WordPress URL

  1. Through WordPress Admin Dashboard:
    The simplest way to change the site URL is through the WordPress admin dashboard. Go to Settings > General. Here, you will find two fields: ‘WordPress Address (URL)’ and ‘Site Address (URL)’. Enter the new URL in these fields and save the changes. This method is straightforward but requires that you can access your WordPress admin area.

  2. Editing wp-config.php File:
    If you have access to your site files, you can directly define the site URL in the wp-config.php file. This is particularly useful if you cannot access the WordPress dashboard. Add these two lines above the /* That's all, stop editing! Happy blogging. */ comment in wp-config.php:

    define('WP_HOME','http://yournewurl.com');
    define('WP_SITEURL','http://yournewurl.com');

    Replace http://yournewurl.com with your actual new URL.

  3. Using functions.php File:
    Another file-based method involves adding a couple of lines to the functions.php file of your active theme. Insert the following lines at the top:

    update_option('siteurl', 'http://yournewurl.com' );
    update_option('home', 'http://yournewurl.com' );

    As usual, replace http://yournewurl.com with your new URL. After loading your site once, these changes can be removed from functions.php.

Troubleshooting Common Issues and Errors

  1. Unable to Access WP-Admin:
    If after changing the URL, you cannot access your admin panel, it’s often due to incorrect URLs in the settings. You can revert the changes by directly accessing your MySQL database using a tool like phpMyAdmin, and editing the wp_options table. Look for the siteurl and home entries and correct them if necessary.

  2. Redirect Issues:
    Incorrect settings can lead to redirection loops or pages failing to load. Check your .htaccess file, which is in your root directory, for any custom redirects or rewrites that might conflict with your new URL settings. Resetting your permalinks through the WordPress admin (if accessible) by going to Settings > Permalinks and hitting save can sometimes resolve these issues.

  3. Mixed Content Errors After Moving to HTTPS:
    If you’re changing to an HTTPS URL, you might face mixed content errors, where some resources are loaded over HTTP. To fix this, ensure all links in your database, theme, and plugins are using HTTPS. Plugins like ‘Really Simple SSL’ can automate this process and help enforce SSL across your site.

Changing your WordPress site’s URL might seem daunting, but following these step-by-step instructions will make the process smoother. Whether you’re updating through the admin dashboard, editing core files, or directly in the database, it’s important to back up your site before making changes. If problems arise, troubleshooting common issues like access errors or redirect problems can help restore your site’s functionality swiftly. With these guidelines, you should be well-equipped to handle the URL change efficiently and with confidence.

Hot this week

How to Set Up Your Professional Email on Outlook, iPhone, and Android (Step-by-Step)

Registering your business email is the first step toward...

The Complete Guide to Choosing Email Hosting for SMEs, Corporates, and Schools

In today’s hyperconnected world, your email is more than...

How Tremhost’s Spam Filtering Works (And Why 2025 Businesses Need It)

If you’re running a business in 2025, chances are...

The Hidden Cost of Using Free Email for Business — And How to Fix It Fast

In business, perception isn’t everything — it’s the first...

How to Move From Gmail to a Professional Business Email — Complete Migration Guide

Making the leap from a free Gmail account to...

Topics

How to Set Up Your Professional Email on Outlook, iPhone, and Android (Step-by-Step)

Registering your business email is the first step toward...

The Complete Guide to Choosing Email Hosting for SMEs, Corporates, and Schools

In today’s hyperconnected world, your email is more than...

How Tremhost’s Spam Filtering Works (And Why 2025 Businesses Need It)

If you’re running a business in 2025, chances are...

The Hidden Cost of Using Free Email for Business — And How to Fix It Fast

In business, perception isn’t everything — it’s the first...

Top 10 Features to Look For in a Business Email Provider (And How Tremhost Meets Them All)

Choosing the right business email provider isn’t just about...

Best Email Hosting in Zimbabwe: Why Tremhost Leads the Market in 2025

In today’s digital economy, email isn’t just how business...
spot_img

Related Articles

Popular Categories

spot_imgspot_img