How To Change My Website URL
Every now and then, you might think about changing the URL of your WordPress website. Unfortunately, it’s not quite as easy as building a new version of your site in a subfolder and then moving it into your root directory. This is because WordPress relies on its URL settings to actually work! Moving your files and database will land you with a broken website. Oops! So if you’re looking to change website URL, here’s how to do it properly in a few easy ways:
Change Website URL – Edit wp-config.php
You can set your URL manually in your wp-config.php file. By adding the following two lines to your wp-config.php, your URL can easily and quickly be changed:
As an aside, this is not the best way to fix the URL – but it’s easy, and it does the job.
Edit Website URL – Edit functions.php
If you use FTP to access your site, this method is a quick way of getting your website back up to speed. First, FTP to the site and get a copy of the theme’s functions.php file. What you will be doing is editing in a text editor before uploading it back to the site. Add the following lines to your site:
Then, upload the file (in the same location) back to your site. Finally, you can load the login page a few times and eventually your site will appear.
Change WordPress URL Directly In The Databse
Here is another way to change WordPress URL:
- First, backup your database.
- Then login to phpMyAdmin and head over to your Databases. Here, you will see a list of your databases. You need to select your WordPress database.
- You will now see the tables in your database. Find wp_options and click on “Browse.”
- A screen will open, and you need to look for the field option_name. Scroll down and find site url.
- Select the “Edit Field” tab and then change your URL to the new address in the option_value box.
- Click “Go”, which saves your information.
- You will now be back at your wp_options table. Click “Edit Field” and then change your URL information in the option_value box.
- Finally, click “Go” to save.
You might also want to learn how to create PDF invoices, so don’t hesitate to go on reading!