phpWordpress

Changing The Site URL in WordPress

There are two fields in WordPress Address (URL) and “Site Address (URL)”. They are important settings, since they control where WordPress is located. These settings control the display of the URL in the admin section of your page, as well as the front end, and are used throughout the WordPress code.

Why Change Your Site URL?

There are several reasons you might want to change your WordPress site URL:

  1. Rebranding: If you’ve changed your brand name or focus, updating your site URL can reflect this change and help you connect better with your audience.
  2. Domain Change: When migrating to a new domain for improved SEO, a better domain name, or simply a personal preference.
  3. Development to Live Site: If you initially set up your site on a temporary domain or localhost and are now moving to a live environment.
  4. Changing from HTTP to HTTPS: Enhancing your site’s security by switching to a secure connection.

Understanding the Site URL and Home URL

In WordPress, there are two important URLs to be aware of:

  • Site URL: This is the address where your WordPress core files reside (the backend).
  • Home URL: This is the address that visitors will use to access your website (the frontend).

Both of these URLs can be set and changed in your WordPress settings or configuration files.

The “Site Address (URL)” setting is the address you want people to type in their browser to reach your WordPress blog.
The “WordPress Address (URL)” setting is the address where your WordPress core files reside.
Note: Both settings should include the http:// part and should not have a slash “/” at the end.

How to Change the Site URL in WordPress

Method 1: Changing Site URL via WordPress Admin Dashboard

  1. Log into Your WordPress Admin Panel: Navigate to your WordPress admin dashboard by going to yourdomain.com/wp-admin.
  2. Go to General Settings:
    • In the left sidebar, click on Settings and then select General.
  3. Update Site Address (URL) and WordPress Address (URL):
    • Look for WordPress Address (URL) and Site Address (URL) fields. Update both fields with your new URL.
    • Ensure that you enter the correct format (including http:// or https://).
  4. Save Changes:
    • Scroll down and click on the Save Changes button at the bottom of the page.
  5. Log Out and Log In: After saving changes, you may be logged out. Log back in using your new site URL.

Method 2: Changing Site URL via wp-config.php File

If you are unable to access your WordPress admin dashboard, you can change the URL through the wp-config.php file.

  1. Access Your Site’s Files:
    • Use an FTP client or your hosting provider’s file manager to access your website files.
  2. Locate the wp-config.php File:
    • Find the wp-config.php file in the root directory of your WordPress installation.
  3. Edit the File:
    • Open the wp-config.php file in a text editor. Add the following lines just above the line that says /* That's all, stop editing! Happy blogging. */:

Edit wp-config.php

It is possible to set the site URL manually in the wp-config.php file.

Add these two lines to your wp-config.php, where “alltechnosolution.com” is the correct location of your site.

<?php
define( 'WP_HOME', 'http://alltechnosolution.com');
define( 'WP_SITEURL', 'http://alltechnosolution.com');
?>

This is not necessarily the best fix, it’s just hard-coding the values into the site itself. You won’t be able to edit them on the General settings page anymore when using this method.

Related Articles

Leave a Reply

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

Back to top button