WordPress – Changing the Site URL and Home Settings

WordPress – Changing the Site URL and Home Settings

Suppose you transfer your WordPress website or alter the URL or domain name for your WordPress installation. In that case, you should remember how WordPress manages itself through its WordPress URL in addition to the site address settings. Learn how to use WordPress hosting.

These settings can be modified directly from the WordPress administration dashboard under settings > General or changed these settings to the wp_options table within the Database.

In this article, we will be discussing the following:

  • Settings for WordPress’ WP_HOME, WP_SITEURL and WordPress
  • Modifying WordPress URLs from the admin dashboard
  • Modifying WordPress URLs direct from databases
  • Find and modify WordPress URL by using RELOCATE

WordPress Settings for WP_HOME, WP_SITEURL and WP_HOME

Two WordPress choices allow you to modify the way that WordPress functions.

  • WordPress address (URL) or WP_SITEURL: Where your WordPress main files are stored.
  • Website Address (URL) or WP_HOMEThe address entered in the browser to access your WordPress blog.

WordPress Address (URL) / WP_SITEURL Site Address (URL) / WP_HOME

 

You can observe in the above example I’ve got my WordPress primary files stored in my public_html/wp directory so they don’t get clogged up in the root of my guide.

However, I still want people to type in https://www.example.com to get to my WordPress site, so I’ve left that set as my Site Address so WordPress knows this is what I want to be displayed instead of the core files location.

This is only one example of what can be accomplished using WordPress URL configurations. It is also possible to change these settings following the transfer of the WordPress site to a different server or evaluate an entirely new structure for your site.

Change the WordPress address in the admin dashboard.

You can also change your WordPress URL settings through an admin’s dashboard. This approach will likely work if you haven’t yet moved your WordPress installation and aren’t experiencing difficulties accessing it.

  1. Connect to the WordPress admin dashboard
  2. Click on Settings >> General
  3. Enter your WordPress address and Website Address. Click to save.

Be aware of these options in the wp-config.php file; the ability to alter them via the dashboard is gone.

  1. Edit your wp-config.php file.
  2. Define your WP_HOME and WP_SITEURL settings by putting these lines at the top of the screen: Copy.
  3. define(‘WP_HOME’,’https://example.com’); define(‘WP_SITEURL’,’https://example.com’);

Modify the WordPress address directly within the Database.

You can also modify the WordPress URL settings within the WordPress database by using this phpMyAdmin tool.

  1. Back up your Database using the cPanel before making any modifications.
  2. Make use of PHPMyAdmin to control the Database of your WordPress database.
  3. Choose your WordPress Database on the left.
  4. Then select your wp_options table.
  5. Your prefix for the wp_ prefix could differ based on the settings you have set for installation.
  6. Select Edit on either the website as well as the home entries.
  7. You might have to search for them using your filter rows function on the top.
  8. You can enter your new value into the value_option field and select “Go.”.

Change and detect the WordPress address by using RELOCATE.

If you’re having trouble connecting to the WordPress dashboard, You can make WordPress automatically find the correct WordPress address by using this RELOCATE flag in your wp-config.php file.

When you set a RELOCATE flag enabled, WordPress will automatically update your WordPress primary files address that is used to try access to this wp-login.php script. This is only affecting the WordPress dashboard, not the actual site.

  1. Edit your wp-config.php file.
  2. In the upper right corner of the file, add a define(‘RELOCATE,’ actual); line: Copy.
  3. define(‘RELOCATE’,true);
  4. Go to your https://www.example.com/wp/wp-login.php Page in your internet browser.
  5. Make sure you type in the path to your WordPress primary files before wp-login.php
  6. Log in to your WordPress dashboard the same way you usually do.
  7. If you go to Settings > General and then General, you will notice that WordPress automatically fills in the WordPress address (URL) field for you, including the URL to your WordPress files.

 

Leave a Reply