• E Martë, Dhjetor 23, 2025

One of our readers recently experienced a critical issue after a seemingly simple URL change brought their entire WordPress site down. This heart-sinking feeling is understandable, as changing WordPress URLs is a delicate process where a single misstep can render your site unreachable or disrupt your internal links. It’s a task that often makes site owners apprehensive.

However, there's no need to worry; we are here to guide you through this process safely and effectively. In this article, we will outline the precise methods we utilize to correctly change WordPress site URLs, ensuring that everything continues to function flawlessly.

Let's ensure your URLs are updated the right way, minimizing potential disruptions and maintaining your site's integrity.

Why Change WordPress Site URLs?

There are numerous compelling reasons why you might need or wish to modify your WordPress URLs:

  • You will need to update site URLs when moving WordPress from a local server to a live site.
  • If you have moved your WordPress site to a new domain name, then you will certainly need to change site URLs to accurately reflect this transition.
  • It is necessary to change the site URLs if you are relocating WordPress to a different directory, such as removing /wordpress/ from your WordPress URL.
  • You will also need to change URLs when moving WordPress from HTTP to HTTPS to ensure a secure connection.

Beyond these scenarios, adjusting the WordPress address settings may be required if you encounter the too many redirects error in WordPress, or when you are troubleshooting other common WordPress errors.

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

When you undertake the task of changing your WordPress URL, you will typically need to update two distinct settings: the WordPress address and the site address.

This distinction can often be a source of confusion for many users, as they may not fully understand the difference between these two crucial settings:

  • Your WordPress address (URL) specifies the exact location where your core WordPress files and folders are stored. This includes essential components such as your admin pages, media files, installed plugins, active themes, and other backend assets.
  • Your site address (URL) in WordPress represents the public-facing URL of your website. This is the address that your visitors will input into their web browsers to access your website. It is the main URL by which your site is known to the world.

For the vast majority of users, both the WordPress address and the site address URLs will be identical. They typically point to the same location, making the setup straightforward.

Nevertheless, in certain specialized cases, such as for larger organizations, WordPress sites might be hosted on a separate server. This approach is often adopted when a corporate website incorporates numerous other applications, and there is a strategic need to isolate where each application is hosted. This isolation can significantly enhance WordPress security by compartmentalizing different parts of the web infrastructure.

With this understanding, let’s explore the various methods to easily change WordPress website URLs. We will cover several approaches, allowing you to choose the most suitable one for your specific situation.

Method 1: Change WordPress Site URLs From Admin Area

This method is widely considered the easiest and most user-friendly, especially for beginners. If you currently have access to your WordPress admin panel, this is the recommended approach.

For instance, this method is ideal when you are performing a planned, controlled modification to your site’s URL—such as moving from HTTP to HTTPS—and you still maintain full administrative access to your dashboard. It is the safest option for users who are not in an emergency situation and can carefully manage the change.

To proceed, simply log in to your WordPress dashboard and navigate to Settings » General.

On this screen, you will find input fields where you can change your WordPress site URLs within the ‘WordPress Address (URL)’ and ‘Site Address (URL)’ boxes.

As previously mentioned, for most websites, these two URLs will be identical. Ensure they are updated accurately to your new desired URL.

After making your modifications, click the ‘Save Changes’ button to apply your new URL settings. It’s crucial to save your changes to ensure they take effect.

Following this, it is highly recommended to visit your website immediately to verify that everything is functioning correctly and that your site is accessible at the new URL.

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

This method becomes invaluable when you have unfortunately lost access to your WordPress admin area after an unsuccessful URL change, but you still retain FTP access to your website. It provides a way to recover your site by directly editing core theme files.

First, you need to establish a connection to your WordPress site using an FTP client. For a detailed guide on this process, refer to instructions on how to use FTP to upload files to WordPress.

Next, you must locate your WordPress theme folder. For the majority of users, this folder will typically be found within a path similar to /wp-content/themes/your-theme-folder/.

Within this theme folder, you need to open your functions.php file. You can edit this file using your preferred text editor, such as Notepad or TextEdit, on your local computer.

Then, append the following code snippet to the very bottom of the file:

update_option( 'siteurl', 'https://example.com' );
update_option( 'home', 'https://example.com' );

It is essential to replace https://example.com with your actual new site URLs. Once you have made these changes, save the file and upload it back to your server using your FTP client.

Now, simply visit your website in a web browser to check if everything has returned to normal and your site is accessible.

The primary benefit of this method is its ability to directly update the site URLs within your WordPress database. WordPress will process and update these database entries for site URLs every time your functions.php file is loaded.

Once your website is back online and operating as expected, it is critically important to remove those two lines of code from your functions.php file. Leaving the code in is unnecessary, as it will continue to update the database every time a page loads, which is redundant once the correct URL is permanently saved in the database.

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

If you are uncertain about which WordPress theme file to edit, or if you are unable to locate your functions.php file, this method offers an alternative solution. It is particularly useful when you have lost access to your WordPress admin area due to an incorrect URL change, but still have FTP access to your site.

This method requires you to add your website URLs directly to your WordPress configuration file, known as wp-config.php. This critical file is situated in the root folder of your website and contains many important WordPress settings.

To modify this file, you will first need to connect to your website using an FTP client. For detailed instructions, please refer to guides on how to use FTP to upload files to WordPress.

Once connected, locate the wp-config.php file. This file can typically be found in the main root directory of your domain.

After finding the file, add the following code snippet 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' );

Remember to replace https://example.com with your actual new domain name. It’s crucial that these URLs are precise.

Now, save your changes to the wp-config.php file and upload it back to your server using your FTP client. Following this, visit your website to confirm that everything is functioning correctly.

Pro Tip: When you define the URLs in your wp-config.php file, these definitions will override any existing settings in your database. As a result, the ‘WordPress Address (URL)’ and ‘Site Address (URL)’ fields in your admin dashboard will appear greyed out and uneditable. This behavior is completely normal when employing this particular method and indicates that your URLs are being managed through the configuration file.

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

Another powerful approach to updating WordPress site URLs involves making direct changes within your WordPress database. This can be accomplished directly from your WordPress hosting account dashboard, typically through a tool like phpMyAdmin.

This advanced method is best reserved for emergency situations. You should only consider using it if you are unable to access your WordPress admin area or your site’s files via FTP. It is particularly beneficial in scenarios where your hosting control panel is the only available access point, such as after a failed migration or when other methods have introduced unforeseen issues.

Important: Before proceeding with any direct database modifications, we strongly recommend creating a comprehensive WordPress database backup. This step is critically important and will allow you to easily revert any WordPress database changes if anything goes wrong during the process. Refer to guides on how to make a WordPress database backup for detailed instructions.

After ensuring your database is backed up, log in to your web hosting account dashboard and locate the ‘phpMyAdmin’ icon, usually found within the ‘Databases’ section.

Note: While the exact steps might vary slightly depending on your specific hosting provider, most cPanel hosting providers, including a popular hosting provider, offer the capability to edit database settings through phpMyAdmin.

Clicking this icon will automatically launch the phpMyAdmin application, which provides a web-based interface for managing MySQL databases. To learn more about this tool, you can refer to a beginner’s guide to WordPress database management with phpMyAdmin.

First, select your WordPress database from the left-hand column. This action will display a list of all tables within your WordPress database.

Then, click on the ‘wp_options’ table option. By default, the database prefix is ‘wp_’, but if you have customized your WordPress database prefix, it might be different.

Now, you will see various rows within the options table. You need to locate the ‘option_name’ column where ‘siteurl’ and ‘home’ are listed. These are the two values you need to change.

First, click on the pencil ‘Edit’ icon located to the left of each row. This will allow you to modify the ‘option_value’ field for ‘siteurl’ and ‘home’ to your new site URL.

You may need to scroll down through the options table to find the ‘home’ option name, as it might not be immediately visible.

Once you have updated both values, simply click the ‘Go’ button in the bottom right corner to save your database changes. Confirm that the changes have been applied.

Finally, visit your website to confirm that everything is functioning as it should at your new URL.

Important: These methods exclusively address the core WordPress Address and Site Address settings. They do not automatically update any links that you have manually inserted within your posts, pages, or other content areas. We will provide guidance on how to update those internal content links in the Frequently Asked Questions section below.

Bonus: Managing Redirects After a URL Change

After you have successfully changed your site URLs using one of the methods described above (especially when transitioning to a new domain), there is one crucial additional step: setting up redirects. Redirects are vital for informing search engines and visitors’ browsers about the new location of your pages. This is essential for preserving your SEO rankings, preventing broken links, and avoiding frustrating 404 errors for your users.

The most efficient way to manage redirects is by using a robust SEO plugin. Many powerful plugins offer a Redirection Manager feature that streamlines this process, making it simple and less prone to errors.

While a free version of some plugins may be available, the premium version often provides comprehensive redirection capabilities, allowing you to redirect your entire website, posts, pages, and other content types without compromising your SEO rankings. Such a feature typically includes a built-in redirection manager that simplifies the creation of website-wide redirects.

Implementing website redirects in this manner preserves the value of inbound links from other sites that were pointing to your old domain. It effectively prevents 404 errors, ensuring a smoother and more positive experience for your website visitors.

To execute this correctly, you will generally need to create a duplicate of your existing site, transfer it to the new domain, and then configure your old site to redirect all traffic to your new site. You can find more detailed instructions in guides on how to update URLs when moving your WordPress website.

If your goal is to redirect individual posts and pages within WordPress, you can refer to beginner’s guides on creating 301 redirects in WordPress for step-by-step instructions.

Frequently Asked Questions (FAQs) About Changing WordPress URLs

Throughout our experience assisting numerous users with creating a WordPress website, starting a blog, or launching an online store, we have encountered and answered a wide range of questions pertaining to changing WordPress URLs. Below are some of the most commonly asked questions we receive, along with their detailed answers.

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

If the WordPress address (URL) and site address (URL) fields appear greyed out and uneditable on the settings page of your admin area, it indicates that these URLs are hardcoded directly within your wp-config.php file. This configuration overrides any settings that would typically be managed through the WordPress dashboard.

To modify your WordPress URL in this situation, you will need to follow Method 3 outlined above. This involves editing your wp-config.php file and adjusting the URL definitions accordingly within that file.

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

It is not uncommon for users, particularly those less familiar with technical configurations, to accidentally alter the WordPress URL and site address settings from the WordPress admin area, leading to site inaccessibility.

To recover from such a situation, you will need to implement one of the alternative methods discussed in this guide to revert the WordPress URLs. This involves directly editing the functions.php file, the wp-config.php file, or making changes within the WordPress database via phpMyAdmin. Choose the method that best suits your access capabilities.

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

Yes, there are indeed WordPress plugins designed for this specific purpose. A well-known example is the Go Live Update URLs plugin.

When you change your WordPress URL, it’s essential to have a mechanism to bulk update all existing links embedded within your WordPress posts, pages, custom post types, and other content areas stored in your database. This type of plugin can be an immense time-saver, preventing the need for manual edits across hundreds or thousands of links.

Beyond its utility for updating URLs when moving websites, such plugins are also frequently employed to migrate websites from various other platforms to WordPress, facilitating transitions such as moving from a hosted WordPress.com site to a self-hosted WordPress.org installation, or migrating content from platforms like Wix to WordPress, and Weebly to WordPress.