Tips on how to change the website url in WordPressIf you go to Settings in the left navigation of your WordPress dashboard and click on General, you’ll find two fields – WordPress Address (URL) and Site Address (URL).

These settings tell WordPress where your site is located. There are times when you might want to change the URL of your WordPress site manually.

This is required when you make changes to the URL settings of your site and all of a sudden the site doesn’t work properly.

When you come across a situation like these, you will need to change the site URL directly.

There are several ways in which you can get it done directly. We’ll talk about two of them.

Method #1: Edit functions.php

This fixing method is the most preferred one. You can launch FTP and edit the functions.php file as mentioned below.

  1. Launch the FTP program that you use.
  2. Navigate to the WordPress directory.
  3. Copy and open the functions.php file in a text editor.
  4. Add the following code after the first “<?php” line.update_option(‘siteurl’,’http://xyz.com’);
    update_option(‘home’,’http://xyz.com’);[N.B.- Replace xyz.com with your own domain name.]
  5. Save and upload the file to your site.

You may need to load the login or admin page a couple of times before your site finally starts to work properly.

Method #2: Edit config.php

This is another method that you can use to fix the WordPress issue in question. You should do it via FTP.

  1. Launch the FTP program that you use.
  2. Go to the WordPress directory.
  3. Copy and open the config.php file in a text editor.
  4. Add the following code.define(‘WP_HOME’,’http://xyz.com’);
    define(‘WP_SITEURL’,’http://xyz.com’);[N.B.- Replace xyz.com with your own domain name.]
  5. Save and upload the file to your site.

That’s how you can change the Site URL directly so that your WordPress site starts to run properly once again.

Leave a Reply

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