• Tuesday, November 18, 2025

Many website owners understand the apprehension that comes with modifying core site settings, especially when it involves changing WordPress URLs. A seemingly minor adjustment can, unfortunately, lead to a website becoming inaccessible or breaking crucial internal links, causing considerable concern.

However, this critical task doesn't have to be a source of stress. This comprehensive guide is designed to walk you through the precise, proven methods for correctly updating your WordPress site URLs. Our aim is to ensure a smooth transition, allowing your website to continue operating flawlessly without any unexpected downtime or broken functionalities.

By following these detailed instructions, you can confidently navigate the process of updating your URLs, ensuring the integrity and accessibility of your WordPress installation.

How to change your WordPress site URLs (step by step)

Why Change WordPress Site URLs?

There are several compelling reasons why you might find it necessary or beneficial to modify your WordPress URLs. Understanding these common scenarios can help you prepare for and execute such changes effectively:

  • Migrating from a Local Development Environment to a Live Server: When you develop your WordPress site on a local machine (localhost) and then deploy it to a live web hosting environment, updating the site URLs is a crucial step to ensure it functions correctly online.
  • Transitioning to a New Domain Name: If you decide to rebrand or relocate your website to a completely different domain name, updating the WordPress site URLs is essential to reflect this change and maintain accessibility.
  • Relocating WordPress to a Different Directory: Sometimes, you might need to move your WordPress installation to a new directory within your server, such as removing a subdirectory like /wordpress/ from your site's URL structure. This also necessitates a URL update.
  • Upgrading from HTTP to HTTPS: Implementing an SSL certificate for enhanced security means transitioning your site from HTTP to HTTPS. This change requires updating your WordPress URLs to use the secure protocol, which is vital for SEO and user trust.

Beyond these primary migration and structural changes, adjusting WordPress address settings can also be a vital troubleshooting step. For instance, you might need to modify URLs if you encounter common issues like "too many redirects" errors or other general website malfunctions that are often linked to incorrect URL configurations.

Understanding WordPress Address vs. Site Address

When you embark on the task of altering your WordPress URL, you will encounter two distinct yet interconnected settings that require your attention: the WordPress address and the site address. This distinction can often be a source of initial confusion for those new to WordPress administration.

Change the WordPress Address and Site URL to Your New Domain
  • WordPress Address (URL): This refers to the directory where your core WordPress installation files and folders reside on your server. It encompasses all essential components of your site, including your administration panels, media uploads, installed plugins, and active themes.
  • Site Address (URL): In contrast, the site address is the public-facing URL of your website. This is the address that your visitors will type into their web browsers to access your website.

For a significant majority of WordPress users, these two URL settings—the WordPress address and the site address—will typically be identical. This configuration simplifies management and is standard for most single-site installations.

However, in certain advanced scenarios, particularly for larger organizations or complex web architectures, these addresses might differ. For instance, a corporation might host its WordPress installation in a separate, isolated location to enhance security protocols or manage various applications more effectively. This allows for segregation of resources and improved overall website resilience.

Now, let's explore the various methods available to update your WordPress website URLs, each suited for different access levels and situations.

Method 1: Changing WordPress Site URLs From the Administration Area

This approach is widely considered the most straightforward and user-friendly option for updating your WordPress URLs. If you currently have full access to your WordPress administration panel, this method is highly recommended due to its simplicity and low risk.

This method is particularly suitable for pre-planned and controlled URL adjustments, such as transitioning your website from HTTP to a secure HTTPS connection. In such scenarios, where you maintain uninterrupted access to the administrative dashboard, you can proceed with confidence and at your own pace.

It stands as the safest option for beginners, offering a clear path to update URLs without needing to delve into code or database modifications. It's ideal when you are not facing an immediate emergency and can carefully review each step.

  1. Begin by logging into your WordPress dashboard with your administrative credentials.
  2. Navigate to Settings » General from the left-hand sidebar menu.
  3. On the General Settings page, you will find two input fields: ‘WordPress Address (URL)’ and ‘Site Address (URL)’. This is where you will input your new site URLs.
Change WordPress address and site address

As previously mentioned, for the vast majority of WordPress installations, both of these URL fields will contain the same address. Ensure that the new URLs entered accurately reflect your desired website address.

  1. After entering your updated URLs, click the ‘Save Changes’ button located at the bottom of the page to apply your modifications.
  2. Finally, it is crucial to visit your website in a new browser tab or window to verify that all functionalities are working as expected and that your site is accessible at the new URL.

Method 2: Modifying WordPress Site URLs via the functions.php File

This method becomes invaluable when you find yourself locked out of your WordPress administration area due to an incorrect URL change, yet you still maintain File Transfer Protocol (FTP) access to your website's server. It provides a reliable way to regain control and rectify the URL settings.

  1. Connect via FTP: Begin by connecting to your WordPress site using an FTP client. This software allows you to browse and manage your website's files directly on the server.
  2. Locate Your Theme Folder: Once connected, navigate to your WordPress theme folder. Typically, this path will resemble /wp-content/themes/your-active-theme-folder/. Ensure you select the folder corresponding to your currently active theme.
  3. Edit functions.php: Inside your active theme's folder, locate the functions.php file. Open this file using a plain text editor of your choice, such as Notepad, TextEdit, or any code editor.
  4. Add the Code Snippet: Insert the following lines of code at the very bottom of the functions.php file. It's crucial to place it correctly to avoid breaking your site.
update_option( 'siteurl', 'https://example.com' );
update_option( 'home', 'https://example.com' );

Remember to replace https://example.com with the correct, full URL of your website. This includes the http:// or https:// prefix.

  1. Save and Upload: Save the modified functions.php file and then upload it back to your server, overwriting the existing file.

After successfully uploading the file, simply visit your website in your browser. This action should trigger WordPress to read the updated URLs from your functions.php file and apply them to the database, bringing your site back online.

The primary benefit of this technique is its ability to directly update the site URLs within your WordPress database. Each time your functions.php file loads, WordPress checks and updates these database entries. However, once your site is fully functional and accessible with the correct URLs, it is strongly advised to remove these two lines of code from your functions.php file. Leaving them in can cause unnecessary database updates on every page load, which is inefficient. Once the database has been updated, the code is no longer needed.

Method 3: Specifying WordPress Site URLs within the wp-config.php File

This method offers an alternative solution if you are unable to identify or access your theme's functions.php file, or if you prefer a more direct configuration. It is particularly useful when you've lost access to your WordPress administration area due to an incorrect URL setting but still have FTP access to your website's files.

The wp-config.php file is a crucial WordPress configuration file, typically found in the root directory of your website. It houses essential settings for your WordPress installation.

  1. Connect via FTP: As with Method 2, establish an FTP connection to your website using your preferred FTP client.
  2. Locate wp-config.php: Navigate to the root folder of your WordPress installation. This is usually the main directory for your domain, where you will find the wp-config.php file.
  3. Edit wp-config.php: Open the wp-config.php file in a text editor.
  4. Add the Code Snippet: Carefully insert the following lines of code directly above the line that reads: /* That’s all, stop editing! Happy publishing. */
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );

Be sure to replace https://example.com with the correct, full URL of your website, including the appropriate http:// or https:// prefix.

  1. Save and Upload: Save the changes to your wp-config.php file and upload it back to your server, replacing the old file.

After performing these steps, visit your website in a browser to confirm that it is now loading correctly at the new URL. The site should be fully accessible and functional.

Important Note: When you define the WP_HOME and WP_SITEURL constants in your wp-config.php file, these settings take precedence over any corresponding entries in your WordPress database. Consequently, the ‘WordPress Address (URL)’ and ‘Site Address (URL)’ fields within your admin dashboard’s General Settings will appear greyed out and uneditable. This behavior is entirely normal and expected when utilizing this configuration method, indicating that your URLs are being securely set via the configuration file.

Method 4: Updating WordPress Site URLs Directly in the Database Using phpMyAdmin

A more advanced but equally effective method for updating your WordPress site URLs involves directly modifying your WordPress database. This can typically be accomplished through the control panel provided by your web hosting account.

This powerful technique is primarily recommended for emergency situations where you are unable to access your WordPress administrative dashboard or your site’s files via FTP. It serves as a last resort when other methods prove inaccessible or ineffective.

This approach is particularly valuable during critical periods, such as after a problematic site migration or when previous attempts to change URLs have led to further complications, leaving your hosting control panel as your sole point of access.

Crucial Precaution: Before proceeding with any direct database modifications, it is absolutely essential to create a complete backup of your WordPress database. This backup will serve as a safety net, allowing you to revert any changes if unforeseen issues arise or if a mistake is made during the process. Regularly backing up your database is a fundamental aspect of website maintenance.

  1. Access phpMyAdmin: Log in to your web hosting account dashboard. Look for the ‘phpMyAdmin’ icon, usually located within a ‘Databases’ or similar section, and click on it.

While the exact steps and interface might vary slightly depending on your specific hosting provider, most hosting control panels offer direct access to phpMyAdmin, a web-based tool for managing MySQL databases.

Upon launching phpMyAdmin, you will be presented with a comprehensive interface for database management.

  1. Select Your Database: In the left-hand column, click on the name of your WordPress database. This action will expand the database, revealing a list of all its tables.
  2. Navigate to wp_options Table: Locate and click on the wp_options table. Please note that while ‘wp_’ is the default database prefix, it might be different if your WordPress installation was configured with a custom prefix for security reasons (e.g., xyz_options).
  3. Locate 'siteurl' and 'home' Options: Within the wp_options table, you will see various rows. You need to find the rows where the ‘option_name’ column displays ‘siteurl’ and ‘home’.
  4. Edit URLs: For each of these rows (‘siteurl’ and ‘home’), click on the pencil ‘Edit’ icon (or similar) located to the left of the row. In the ‘option_value’ field, carefully enter your new, correct site URL. You may need to scroll down the table to find both the ‘siteurl’ and ‘home’ options.
  5. Save Changes: After updating the URL for each option, click the ‘Go’ button, typically found in the bottom right corner, to save your database modifications.

Once these changes are saved, visit your website in a web browser to confirm that it is loading correctly and functioning as expected at the new URL.

Important Consideration: It's critical to understand that these database methods primarily adjust the core WordPress Address and Site Address settings. They do not automatically update any hardcoded links or URLs that you may have inserted within your post content, pages, custom fields, or other content areas. For a comprehensive update of all internal links across your site, additional steps, often involving specialized plugins, will be necessary, which we will address in the subsequent FAQ section.

Bonus: Effectively Managing Redirects After a URL Change

Once you have successfully updated your site URLs using one of the methods outlined above, particularly when transitioning to an entirely new domain, a crucial subsequent step is to implement proper redirects. Redirects serve as essential signposts, informing search engines and web browsers about the new location of your web pages. This process is indispensable for maintaining your website's search engine optimization (SEO) rankings and preventing visitors from encountering frustrating 404 "page not found" errors.

The most efficient and error-free way to manage these redirects is by utilizing a comprehensive SEO plugin that includes a robust Redirection Manager. Such tools simplify the complex task of configuring redirects, ensuring that all old URLs correctly point to their new counterparts.

A well-implemented redirection manager within a powerful SEO plugin allows you to effortlessly create site-wide redirects. This capability is vital for ensuring a seamless transition, especially when moving an entire website.

By effectively redirecting your website, you achieve several key benefits:

  • Preserving Backlinks: It ensures that valuable backlinks from other websites pointing to your old domain are passed on to your new URLs, retaining their SEO value.
  • Preventing 404 Errors: Visitors attempting to access old URLs will be smoothly directed to the correct new pages, preventing broken links and enhancing user experience.
  • Maintaining SEO Rankings: Search engines will understand the permanent move, helping to preserve your existing search rankings and authority.
  • Improving User Experience: A smooth redirection process means users are always directed to the content they seek, reducing frustration and improving overall site usability.

To execute this process correctly, the typical workflow involves creating an exact duplicate of your current site, migrating it to the new domain, and then configuring the old domain to permanently redirect all traffic to the new one. This ensures that every piece of content, from posts and pages to images and assets, is accessible at its new location.

For more detailed guidance on how to manage this process, especially when updating a large number of URLs after moving your WordPress website, consult resources specifically dedicated to website migration and URL updating best practices. Additionally, for redirecting individual posts or pages, learn about creating 301 redirects, which are permanent redirects signaling to search engines that a page has moved permanently.

Frequently Asked Questions (FAQs) Regarding WordPress URL Changes

Throughout our experience in assisting numerous users with their WordPress websites, blogs, and online stores, we've frequently encountered a range of questions pertaining to the modification of WordPress URLs. Below, we address some of the most common inquiries to provide clarity and comprehensive solutions.

Why are my WordPress Address and Site Address fields uneditable (greyed out)?

If you observe that the ‘WordPress Address (URL)’ and ‘Site Address (URL)’ fields within your administration area's General Settings are greyed out and cannot be edited, this typically indicates that these URLs have been explicitly defined or "hardcoded" within your website's wp-config.php file. This configuration overrides any settings that might be stored in the database.

To modify your WordPress URL in this scenario, you will need to apply the steps outlined in Method 3: Specifying WordPress Site URLs within the wp-config.php File. This involves accessing and editing your wp-config.php file directly to update the defined URLs.

How can I recover my WordPress site if I accidentally changed the URL settings incorrectly?

It's a common occurrence for users, particularly those less experienced with technical configurations, to accidentally misconfigure the WordPress URL and site address settings from within the WordPress administration area. This can unfortunately render your site inaccessible.

To successfully recover your website from such a situation, you will need to utilize one of the alternative methods discussed in this guide to revert the WordPress URLs to their correct values. This typically involves editing the functions.php file (Method 2), modifying the wp-config.php file (Method 3), or directly updating the WordPress database using phpMyAdmin (Method 4).

Is there a reliable WordPress plugin available to bulk update URLs across all posts, pages, and other content within the database?

Yes, there are indeed specialized WordPress plugins designed to handle bulk URL updates, which are invaluable time-savers during site migrations or extensive URL changes. A widely recognized plugin for this purpose is often referred to as a "Go Live Update URLs" type plugin, or similar tools available in the WordPress plugin repository.

When you change your WordPress URL, it's not enough to just update the core site settings. Many internal links embedded within your blog posts, pages, custom post types, and other content areas in your database will still point to the old URL. A dedicated URL update plugin can scan your entire database and replace all instances of the old URL with the new one, ensuring all internal links remain functional.

Such plugins are extremely beneficial not only for routine website migrations but also when transferring content from various other platforms to WordPress, ensuring a smooth and comprehensive transition of all linked content.