How to Change WordPress Link Settings (4 Easy Ways)

WordPress addresses and website addresses (or URLs) are very important for websites. They are like your website's door number on the web, telling us how to find your website files and admin pages. You want to change your WordPress URL; for example, if you've changed to a new domain name, want to put your website under a subdomain, no longer use the "www" prefix, want to move your website files, or upgrade from HTTP to HTTPS.

There are a number of different ways to change a URL for whatever reason. Some of these methods can be complicated, but others are relatively simple. Depending on your situation, you can choose the method that works best for you to change your URLs, so let's take a look at some of the ways you can change your WordPress link settings:

How to Change WordPress Link Settings (4 Easy Ways)

Changing WordPress URLs via the Admin Dashboard

The first and most common method is to change the WordPress URL directly from the admin dashboard. In the admin menu, go toSettings > Generalto access the General Settings screen. The following can then be updated:

  • WordPress Address (URL): The address to access your site.
  •  Site Address (URL): The address of your WordPress core files.
How to Change WordPress Link Settings (4 Easy Ways)

Both should match unless you provide your own directory for WordPress. Always remember to click"Save changes"After that, your WordPress dashboard is now only accessible via the new URL. Therefore, be sure to check that you are entering the correct URL. If you accidentally enter the wrong URL, you can change it by editing the wp-config.php fileto override the settings in the Admin screen (we'll talk about this method below).

Attention:If the field above is grayed out, it's probably because you already have hardcoded values in your wp-config.php file. In this case, change the method.

Changing the WordPress URL in the wp-config.php file

The second most common way to change a WordPress URL is in the wp-config.php file. It's important to note that the values in wp-config.php override the settings in the WordPress admin screen. If these fields are not editable (as shown below), it is likely because they are hardcoded in this file.

How to Change WordPress Link Settings (4 Easy Ways)

The wp-config.php file is usually located in the root directory of your WordPress site and can be accessed via FTP, SSH or WP-CLI. In your wp-config.php file, add these two lines above the line that tells you to stop editing:

define( 'WP_HOME', 'http://yoursiteurl.com' );
define( 'WP_SITEURL', 'http://yoursiteurl.com' );

Save your wp-config.php file and close it. When going to the General Settings screen in the WordPress administrator, you will see that these two fields are now grayed out. They cannot be edited unless these two lines are removed from wp-config.php.

To access these settings in the dashboard again, simply remove this line of code from the wp-config.php file.

How to Change WordPress Link Settings (4 Easy Ways)

Change WordPress URLs directly in the database

The third method that can be used to change a WordPress URL is to change it directly in the WordPress database.

First open phpMyAdmin in the Pagoda database

  1. . Click wp-options.
  2. variationThese two documentscenterone of these
  3. Once you've clicked in, you'll putWordPressAddress (URL)transformJust go back to the original site address.

Just click Save after making changes.

Changing WordPress URLs with WP-CLI

The fourth option is to access your site and edit the URL using the WordPress Command Line Interface (WP-CLI). you will need to access your site via SSH (available to all Kinsta customers) and be familiar with the process of accessing your site using the WP-CLI. The command to edit the URL is as follows:

wp option update home 'http://yoursiteurl.com'
wp option update siteurl 'http://yoursiteurl.com'
How to Change WordPress Link Settings (4 Easy Ways)

Change WordPress Login URL

Want to change the URL for your WordPress login, but don't want to change the URL for your live site. The login URL is usually your domain name followed by /wp-admin or /wp-login, but it can be changed to something simpler to provide a better user experience for your users and customers, or branded for your webmasters and to remove obvious references to WordPress. 's obvious references. The WordPress login URL can be changed manually or by installing a plugin.

Redirect after changing WordPress URL

After changing a WordPress URL, you need to make sure that anyone using the old URL is redirected to the new one and doesn't receive an error.

If you need to change the URL of WordPress because you have a new domain name or want to upgrade to HTTPS, there are many ways to do it. You can change the settings directly in the WordPress administration, edit the wp-config.php file manually, or modify the database. If you are familiar with command line operation, you can also use WP-CLI to do it. Depending on your situation and preferences, you can choose the most suitable method to change the URL, no matter which method you choose, as long as you do it correctly, you will soon have a new URL for your website.


Contact Us
Can't read the article? Contact us for a free answer! Free help for personal, small business sites!
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
Posted by photon fluctuations, retweeted with attribution:https://www.361sale.com/en/8841/

Like (1)
Previous April 30, 2024 pm3:11
Next May 1, 2024 pm12:46

Recommended

Leave a Reply

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

Contact Us

020-2206-9892

QQ咨询:1025174874

E-mail: info@361sale.com

Working hours: Monday to Friday, 9:30-18:30, holidays off

Customer Service
In order to facilitate global user registration and login, we have canceled the telephone login function. If you encounter login problems, please contact our customer service for assistance in binding your email address.