How To Change Your WordPress URL

How To Change Your WordPress URL

Last modified: June 18, 2026

FAQ
Fiverr freelancers

Changing your WordPress URL is a multi-step process that touches several files and settings. Done carefully and in the right order, it is a clean migration. Done out of order, or without a backup, it can leave your site inaccessible. This guide covers all four required steps, plus a fifth step that most tutorials skip: updating the old URLs still embedded in your database.

Before starting, understand the difference between the two URL fields in Settings > General: WordPress Address (URL) and Site Address (URL). Most sites keep them identical, but they can be different. The WordPress Address is where your WordPress core files live. The Site Address is what visitors type in their browser. This distinction matters if you install WordPress in a subdirectory (for example, yoursite.com/wordpress) but want the site to appear at yoursite.com. In that case, the two fields intentionally differ. Changing only one and not the other is one of the most common causes of broken migrations.

Also consider whether a URL change is the right move at all. If your site has years of inbound links, established rankings, and indexed content, changing your domain carries real SEO risk. Every page on the old domain becomes a redirect hop. Third-party backlinks pointing to the old address can take months to pass full link equity through 301 redirects, and some never do. If you are only rebranding a subdomain or moving from HTTP to HTTPS, the risk is lower, but a full domain change on an established site should be treated as a major decision, not a routine task.

If you are switching from HTTP to HTTPS, note that changing the URL in Settings alone will not complete an SSL migration correctly. The SSL certificate needs to be installed first, then the URL fields updated, and then a database search-and-replace run to update hardcoded HTTP references. The steps in this guide apply to both scenarios. Once your new URL is live, any old links pointing to the previous address will need to be handled with redirects. A WordPress redirect plugin makes this straightforward, letting you map old URLs to new ones and preserve your SEO rankings without touching server config files.

Show More

* This button will show the rest of the post and open up an offer from a vendor

Step One: Backup

Before touching any WordPress settings or files, take a complete backup of your site. If something goes wrong mid-process, a backup is the only way to restore without losing data.

You need two things backed up:

  • Your database — this contains all your posts, pages, settings, and user data. This is the critical one.
  • Your files — the WordPress core, theme files, plugins, and uploaded media in wp-content/.

The easiest way is to use a WordPress backup plugin like UpdraftPlus or All-in-One WP Migration. Run a full backup, download the backup files to your computer, and confirm the download is complete before proceeding.

If you prefer a manual approach: export the database from phpMyAdmin (available in your hosting control panel), and download your wp-content folder via FTP. Store both files somewhere safe — not just on the server you’re working on.

Do not skip this step. URL changes can make your WordPress admin temporarily inaccessible, and if something goes wrong in the wp-config.php or .htaccess file, having a backup means the recovery is a few minutes, not hours.

Step Two: Change The URL Within Your WordPress Dashboard

Go to Settings > General in your WordPress admin. You will see two fields: WordPress Address (URL) and Site Address (URL). In most setups, these are identical. Update both to your new domain.

The only time these fields should differ is if you are running an advanced setup where WordPress core files live in a subdirectory but the public-facing site sits at the root domain. For example, WordPress might be installed at yoursite.com/wordpress while visitors access the site at yoursite.com. In that case, the WordPress Address points to the subdirectory and the Site Address points to the root. If you are moving the entire installation to a new domain, update both fields to the new domain, keeping the same subdirectory structure if one exists.

One of the most common mistakes at this stage is inconsistency with www vs non-www. If you are moving to https://www.newdomain.com, both fields must include the www prefix. If your site uses the non-www version, both must omit it. Mixing them causes redirect loops and split canonicalization. Check your SSL certificate as well: a certificate issued for www.newdomain.com will not cover newdomain.com unless it is a wildcard or multi-domain certificate.

After saving, WordPress will log you out and redirect to the new URL. Have your new domain pointing to the correct server before making this change, or you will not be able to log back in without manually editing the database or wp-config.php.

Step Three: Change The Domain In The wp-config.php File

If you are locked out after the previous step — or want to set the URL before going through the dashboard — you can define it directly in wp-config.php.

Connect to your server using an FTP client (your hosting control panel will have the FTP credentials). Navigate to your site’s root folder and open wp-config.php in a text editor.

Add these two lines anywhere before the line that reads /* That's all, stop editing! Happy blogging. */:

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

Replace example.com with your actual new domain, and make sure to use https:// if your site has an SSL certificate. Save the file and upload it back to the server. WordPress should now load at the new URL and your admin access should be restored.

Step Four: Setup Redirects

Once the URL is updated, set up 301 redirects from the old domain to the new one so that external links and bookmarks continue to work and so search engines transfer any ranking signals to the new URL.

Connect via FTP again and locate the .htaccess file in your site’s root folder. Open it in a text editor and add the following code at the top (above the existing WordPress rewrite rules):

#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

Replace example.com with your new domain. Save the file and upload it back to the server.

To verify the redirect is working, visit your old URL in a browser (or use a tool like httpstatus.io) and confirm it resolves to the new domain with a 301 status code.

Step Five: Update Internal URLs in the Database

This is the step most tutorials skip — and the most common cause of broken images, links, and layout issues after a URL change.

When you change your WordPress URL, all the content in your database still contains references to the old URL: image paths, internal links in posts, widget settings, and theme option values. These do not update automatically.

To fix this, you need to run a search-and-replace on your database, swapping the old URL for the new one.

Using a plugin: A URL replacement plugin (search the WordPress plugin directory for “search replace URL” or “better search replace”) can handle this without touching the database directly. Install it, enter your old URL in the search field and your new URL in the replace field, select all tables, and run a dry run first to preview what will change. Then run the live replacement.

Using WP-CLI (if available on your host):

wp search-replace 'https://oldsite.com' 'https://newsite.com' --all-tables

After running the replacement, clear your WordPress cache if you use a caching plugin, then check several posts and pages to confirm images load correctly and internal links resolve to the new domain.

After Changing Your WordPress URL: What to Check

Once all four steps are complete, run through this checklist to confirm everything is working correctly:

  • Visit your new URL in a browser. The site should load without redirect loops.
  • Log into your WordPress admin at the new URL (/wp-admin)
  • Check Settings > General to confirm both URL fields show the new domain
  • Open a few posts and pages. Confirm images load and internal links point to the new domain.
  • Test your old URL. Confirm it redirects to the new domain with a 301 (use httpstatus.io to verify the status code).
  • In Google Search Console, add the new domain as a property and submit your sitemap. If this is a full domain change (not just HTTP to HTTPS), also use the Change of Address tool under Settings in the old property. This signals to Google that the move is intentional and accelerates recrawling of the new domain.
  • Check your email settings. Transactional email plugins such as WP Mail SMTP, FluentSMTP, and similar tools often store the site URL in their configuration. Contact forms, order confirmation emails, and password reset emails may break or send from the wrong domain after a URL change. Open each active email plugin and confirm the sender domain is updated.

Changing your WordPress URL is a careful, sequential process. When done properly, your site and its content transfer cleanly to the new domain.

Recap:
Save 4 Later
Email liked links to yourself

    Stay Updated with WordPress Insights

    Get the latest WordPress tips, theme reviews, and industry deals delivered to your inbox.