• E Mërkurë, Janar 21, 2026

Many website owners have experienced the anxiety that comes with changing WordPress URLs. A seemingly simple update can unexpectedly render an entire site unreachable or break crucial internal links, causing significant disruption. This delicate process often makes site owners hesitant.

However, with the right approach and careful execution, updating your WordPress URLs can be a straightforward task. This guide will provide detailed, step-by-step instructions on the various methods to correctly change your WordPress site URLs, ensuring your website remains fully functional and accessible throughout the process.

Why Change WordPress Site URLs?

There are several common scenarios where modifying your WordPress URLs becomes necessary:

  • When transferring your WordPress installation from a local development environment to a live web server.
  • If you have migrated your WordPress site to a completely new domain name.
  • When repositioning your WordPress installation to a different directory, such as removing a "/wordpress/" segment from your site's URL structure.
  • During the transition of your website from HTTP to HTTPS to enhance security.

Additionally, adjusting WordPress address settings can be a troubleshooting step for common issues like "too many redirects" errors or other general website errors that impact accessibility.

What’s the Difference Between WordPress Address vs. Site Address?

When updating your WordPress URL settings, you will encounter two distinct fields: the WordPress Address (URL) and the Site Address (URL). Understanding the difference between these two is crucial:

  • WordPress Address (URL): This refers to the directory where your core WordPress files and folders are located. This includes all administrative pages, media uploads, plugins, and themes.
  • Site Address (URL): This is the public-facing URL that visitors type into their web browsers to access your website. It represents the front end of your site.

For most websites, these two URLs will be identical. However, in specific architectural setups, such as those used by larger organizations, the WordPress files might be hosted on a separate server or in a distinct location from the public-facing site to improve security or manage various applications.

Let's explore the various methods for easily changing your WordPress website URLs.

Method 1: Change WordPress Site URLs From Admin Area

This method is generally the simplest and most recommended for beginners, provided you have active access to your WordPress administration panel. It is ideal for planned and controlled URL changes, such as moving from HTTP to HTTPS, when you can still log into your dashboard without issues.

This approach allows for a careful, non-emergency update and is the safest option for maintaining site stability.

  1. Log in to your WordPress dashboard.
  2. Navigate to Settings » General.
  3. Locate the ‘WordPress Address (URL)’ and ‘Site Address (URL)’ fields. Update both fields with your new site URL. For the majority of websites, these two URLs will be the same.
  4. Click the ‘Save Changes’ button to apply your new URL settings.

After saving, it is important to visit your website to confirm that all functionalities are working correctly with the updated URLs.

Method 2: Change WordPress Site URLs Using functions.php File

This method is particularly useful if you have lost access to your WordPress admin area after an unsuccessful URL change, but still have FTP access to your site’s files. It allows you to programmatically update the URLs.

  1. Connect to your WordPress site using an FTP client.
  2. Locate your active WordPress theme folder. This is typically found at /wp-content/themes/your-theme-folder/.
  3. Open the functions.php file within your theme folder using a text editor.
  4. Add the following code to the very bottom of the file:
    update_option( 'siteurl', 'https://example.com' );
    update_option( 'home', 'https://example.com' );

    Important: Replace https://example.com with your actual new site URLs.

  5. Save your changes and upload the modified functions.php file back to your server via FTP.

Now, visit your website to verify that it is loading correctly. This method updates the site URLs directly in the database each time the functions.php file is loaded. Once your site is operational with the correct URLs, it is crucial to remove these two lines of code from your functions.php file. Leaving them in can cause unnecessary database updates on every page load and is no longer needed once the correct URLs are established.

Method 3: Change WordPress Site URLs Using wp-config.php File

If you are unsure which theme file to edit or cannot locate your functions.php file, this method provides an alternative. It is suitable when you have lost access to your WordPress admin area due to a URL issue but still maintain FTP access.

This approach involves defining your website URLs directly within your WordPress configuration file, wp-config.php, which resides in the root directory of your website and contains essential WordPress settings.

  1. Connect to your website using an FTP client.
  2. Locate the wp-config.php file, typically found in the root folder of your domain.
  3. Edit the wp-config.php file and add the following code just above the line that states, ‘That’s all, stop editing! Happy publishing’:
    define( 'WP_HOME', 'https://example.com' );
    define( 'WP_SITEURL', 'https://example.com' );

    Important: Replace https://example.com with your actual domain name.

  4. Save your changes and upload the file back to your server.

After uploading, visit your website to ensure everything is functioning as expected. When URLs are defined in your wp-config.php file, these settings override any corresponding entries in your database. Consequently, the ‘WordPress Address (URL)’ and ‘Site Address (URL)’ fields in your admin dashboard will appear greyed out, which is a normal indication of this method being in effect.

Method 4: Change WordPress Site URLs in the Database Using phpMyAdmin

Updating WordPress site URLs can also be done by directly modifying your WordPress database through your web hosting account dashboard. This powerful method is best reserved for emergency situations where you cannot access your WordPress admin or your site’s files via FTP.

It is particularly effective after a failed site migration or when other methods have proven unsuccessful, making your hosting control panel the only available entry point.

Important: Before proceeding with any database modifications, it is highly recommended to create a comprehensive backup of your WordPress database. This crucial step provides a safeguard, allowing you to revert any changes if unforeseen issues arise.

  1. Log in to your web hosting account dashboard.
  2. Locate and click on the ‘phpMyAdmin’ icon, usually found in the ‘Databases’ section. (Note: The exact steps may vary slightly depending on your hosting provider, but most cPanel-based providers offer direct access to phpMyAdmin.)
  3. Once phpMyAdmin launches, click on your WordPress database in the left-hand column to display its tables.
  4. Select the ‘wp_options’ table. (The database prefix might be different from ‘wp_’ if it was customized during installation.)
  5. Within the options table, locate the ‘option_name’ column and find the entries for ‘siteurl’ and ‘home’.
  6. Click the ‘Edit’ icon (often a pencil) next to each of these rows.
  7. In the ‘option_value’ field, change the existing URL to your new site URL. You may need to scroll down to find the ‘home’ option name.
  8. Click the ‘Go’ button in the bottom right corner to save your database changes.

After saving, visit your website to confirm that it is working as expected. It is important to remember that these database methods only update the core WordPress Address and Site Address settings. They do not automatically update links embedded within your posts, pages, or other content areas, which may require additional steps, as discussed in the FAQ section.

Managing Redirects After a URL Change

After changing your site URLs, especially when migrating to a new domain, a critical final step is to set up proper redirects. Redirects are essential for guiding search engines and visitors’ browsers to your new pages, which helps preserve your SEO rankings and prevents frustrating 404 errors.

A simple way to manage redirects is by utilizing a robust redirection plugin. Such tools offer a powerful redirection manager that streamlines this process, ensuring accuracy and minimizing potential errors.

When transitioning your entire website, posts, and pages to a new domain, a comprehensive redirection tool can help maintain your SEO rankings. This ensures that links from external sites pointing to your old domain are correctly redirected, preventing broken links and providing a seamless experience for your visitors.

To implement this effectively, you would typically duplicate your existing site, transfer it to the new domain, and then configure redirects from the old site to the new one. For specific guidance on updating URLs during a WordPress website migration, detailed resources are available. Similarly, for setting up individual post and page redirects, specific instructions on creating 301 redirects in WordPress can be followed.

Frequently Asked Questions (FAQs) About Changing WordPress URLs

Below are some of the most common questions regarding WordPress URL changes, compiled from years of assisting users with website development and management.

Why are my WordPress Address and Site Address fields greyed out?

If the WordPress Address (URL) field appears greyed out on your settings page within the admin area, it indicates that the URLs have been hardcoded directly into your wp-config.php file. To modify your WordPress URL in this scenario, you will need to follow Method 3 outlined above to edit your wp-config.php file and adjust the URL accordingly.

How do I recover my WordPress site after accidentally changing the URL settings?

It is not uncommon for users to inadvertently change the WordPress URL and site address settings from the admin area, leading to site inaccessibility. To recover from such a situation, you will need to revert the WordPress URLs by applying the instructions detailed in Method 2 (editing functions.php), Method 3 (editing wp-config.php), or Method 4 (directly modifying the WordPress database) to restore the correct URLs.

Is there a WordPress plugin that can update URLs in all blog posts, pages, and other content areas in bulk?

Yes, there are plugins specifically designed to facilitate bulk URL updates across your WordPress site. When you change your WordPress URL, particularly during migrations, you will need a reliable tool to update links embedded within your posts, pages, and various other content entries within your database. Such a plugin can significantly save time and effort. These tools are also widely used for migrating websites to WordPress from other platforms, ensuring all internal links are correctly updated post-migration.