Skip to content
Follow
CMS Ubuntu Linux

How to Rebrand (or Change Domain Name) in WordPress

Richard
Written by
Richard
Jul 28, 2022 Updated Jul 14, 2026 5 min read
How to Enable or Disable Microsoft Defender Cloud Protection
How to Enable or Disable Microsoft Defender Cloud Protection

Changing your WordPress website’s domain name tells WordPress and your server about your new web address, making sure visitors and search engines find your site correctly.

This process ensures a smooth transition when your brand evolves or you get a better web address. You need to update core settings and set up redirects to avoid broken links and help search engines recognize the change.

Successfully rebranding your WordPress site involves telling WordPress about the new domain. This guide helps you achieve this, even for complex setups. I recently updated GeekRewind.com to a new domain in under an hour.

You can do this yourself if you have direct access to your website’s files and database. This typically means having SSH or a file manager connection.

⚡ Quick Answer

Change your WordPress domain by registering a new domain, pointing it to your host, creating a new server block or virtual host, updating your WordPress database with the new URL, and ensuring proper redirects.

Changing a domain name in WordPress

As mentioned above, users can easily change or rebrand their websites hosted with WordPress, and the steps below describe the process.

Register a new domain name

Registering a new domain name is the first step to rebrand your WordPress site with a new web address. This new domain needs to point to the same server where your current website is located. If you’re not sure how to do this, there are guides available to help you register a domain name easily.

If you haven’t registered a domain name before, the post below shows you how.

How to register a domain name

Once you have registered the domain name, point the name to the same server host IP as your current website.

Create a new virtual host or server block

After getting your new domain name, you need to set up a special space on your web server for it. This is called a virtual host if you’re using Apache, or a server block if you’re using Nginx. Guides can help you create one if you haven’t done this before.

If you have not yet created a virtual host or server block, this section explains the process. A virtual host or server block acts like a separate website on your server, allowing you to manage multiple sites from one IP address. Following these steps ensures your new domain name correctly points to your WordPress installation.

Your WordPress environment may have unique parameters and definitions that differ from other setups. For instance, a multisite installation will include specific configurations distinct from a single-site setup, affecting how you approach rebranding or changing your domain name.

I use Nginx here. My new server block looks similar to the one below. websitesforstudents.com will be redirected to the new domain geekrewind.com:

💻Code
server {
        listen 80;
        listen [::]:80;
        server_name geekrewind.com www.geekrewind.com;
        return 301 https://$host$request_uri;

        include snippets/well-known.conf;
}

server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name www.geekrewind.com;

        return 301 https://geekrewind.com$request_uri;

        include snippets/well-known.conf;
        ........................................
        ........................................
}

server {
        listen 443 ssl http2;
        listen [::]:443 ssl;
        server_name geekrewind.com;
        
        return 301 https://geekrewind.com$request_uri;

        include snippets/well-known.conf;
        .........................................
        .........................................
}

I have three server blocks. The first one is simply redirecting HTTP to HTTPS. The second block redirects WWW to the new non-WWW domain. Finally, the last block redirects non-WWW to the new non-WWW domain.

Blocks with listen 443 and http2 definitions have Let’s Encrypt SSL certificate configurations for new and old websites.

Below is how to request Let’s Encrypt SSL certificates

For the current website referenced in the current server block, replace all current domain names with new ones in the current server block file.

Update WordPress database

Updating your WordPress database is key to changing all your old website addresses to your new domain name. You’ll need to log into your MySQL server and run specific commands to update your site’s URLs within the database. You can check current URLs before you make any changes.

Sign on to your MySQL server.

🐧Bash / Shell
sudo mysql -u root -p

Type a password or press Enter to log on.

There, change to your WordPress database.

💻Code
use wpdatabse;

Next, run the commands below to view the current URLs.

💻Code
SELECT option_name, option_value FROM wp_options WHERE option_name IN ('siteurl', 'home');

That will display lines similar to the one below:

💻Code
+-------------+------------------------------------+
| option_name | option_value                       |
+-------------+------------------------------------+
| home        | https://geekrewind.com     |
| siteurl     | https://websiteforstudeents.com    |
+-------------+------------------------------------+
2 rows in set (0.00 sec)
⚠️Warning
Next, run the commands below to update the values for the home and site tables.
💻Code
UPDATE wp_posts SET guid = replace(guid, 'https://geekrewind.com','https://geekrewind.com');
⚠️Warning
Next, run the commands below to update the post_content value in the wp_posts table:
💻Code
UPDATE wp_posts SET post_content = replace(post_content, 'https://geekrewind.com', 'https://geekrewind.com');

Next, run the commands below to update the meta_value value in the wp_postmeta table:

💻Code
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'https://geekrewind.com', 'https://geekrewind.com');

Exit the database console.

Double-check your work

After moving your WordPress site and updating the database, it’s important to double-check that everything is working right. Once you’re sure everything is functioning as expected, restart your web server, whether it’s Nginx or Apache, to finalize the changes and apply all updates.

If everything is working, restart Nginx or Apache. I hope all is well.

That should do it!

Conclusion:

  • Changing a domain name in WordPress involves several crucial steps to ensure a smooth transition.
  • Register a new domain name and update DNS records to the current server host IP.
  • If applicable, create a new virtual host or server block to handle the new domain and ensure SSL certificate configurations.
  • Update the WordPress database to replace all instances of the old domain with the new one.
  • Double-check all changes made and restart the server to ensure proper functionality.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Setup WordPress with Nginx and Cloudflare on Ubuntu
CMS How to Setup WordPress with Nginx and Cloudflare on Ubuntu

No comments yet — be the first to share your thoughts!

Leave a Comment

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