Blogging Tips

How to Do a WordPress URL Change [Bonus:Change Login URL]

wordpress url change

WordPress URL Change: Wondering how to change the URL of WordPress Website/Blog? Well i am going to walk you through all the methods you can use to do the same.

WordPress is the most popularly used Content Management System (CMS) on the Web. It is used by more than half of Websites. Started as a Blogging platform, WordPress is now used for small business websites to even large E-Commerce Websites. It is highly customizable and powerful CMS which makes it the most popular.

Some of the Advantages of WordPress are:

  • Free of Cost.
  • Large Number of Themes.
  • Tons of Plugins.
  • Huge community for support.
  • Robust.
  • Easy to Install and Setup.
  • Less Skills needed.
  • Regularly Updated.
  • and many more….

Check Out How to Install WordPress on your Local Computer Within Minutes.

Why WordPress URL Change?

WordPress URL Change is mostly done when we need to move our Website from one Domain to another. Say we are having our website hosted with a domain name and we need to to use another domain name for some reason. The process of wordpress URL change is pretty simple and one can easily do it. WordPress keeps track of the Website using two parameters-WordPress Address and Site Address.

Or

If you screwed up the Website’s  URL parameters and is no longer accessible or is working properly.

WordPress Address URL is the location of the WordPress installation(where core WordPress files are).

Site URL is the address which we type in to reach the Website.

These two strings are very important- It defines the URL for all the resources that we are going to use on the Website.

There are methods to do a WordPress URL change:

  1. Change WordPress URL from Dashboard.
  2. Editing Config.php file.
  3. Editing Functions.php file.
  4. Making Changes in database.
  5. WordPress Relocate Method.

Lets get started!

1. WordPress URL change from Dashboard:

wordpress url change

  • Head to Settings > General.
  • Fill in the two sections WordPress Address (URL) and Site Address (URL).
  • Save!

2. WordPress URL Change-Editing Config.php file:

  • Login to the Dashboard of Web Hosting Server.
  • Mine is Cpanel, so i have logged into my CPanel Dashboard.
  • Open File Manager.
  • Navigate to the WordPress Installation location on the File Manager.
  • Find wp-config.php file.
  • Open the file in Code Editor or Edit View.
  • Add the lines of code in the wp-config.php file:
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
  • Save the File.

Note: This method basically Hard codes the URL settings of the Website to the WordPress Configuration. You won’t be able to edit these settings from Settings anymore.

3. WordPress URL Change-Editing functions.php file:

This method can be used to get the site up and running quickly by editing the Active Theme’s functions.php file.

  • Login to the Dashboard of Web Hosting Server.
  • Open File Manager.
  • Navigate to the WordPress Installation location on the File Manager.
  • Open wp-content folder.
  • Open themes folder inside the wp-content folder.
  • Open the Active theme’s folder.
  • Find and Edit the functions.php file of the Theme.
  • Add the lines of code to functions.php:
update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );
  • Save the file and Done.
  • Load the website a few times and you can see the site has been back up.

If the Theme doesn’t have a functions.php file, Don’t panic. Create a functions.php file using text editor and Add the following code:

<?php
update_option('siteurl','http://example.com');
update_option('home','http://example.com');
?>

Note: Be sure to replace the example.com with your own domain name…Obviously! duhh…

Remove these lines from the functions.php file after the site is back and running!

4. Change WordPress URL from Database:

wordpress url change

  • Access the database by logging into the Web Hosting Dashboard.
  • Open the Database of the WordPress Installation.
  • open wp_options table in Database.
  • Edit the values siteurl and home from the table.

wordpress url changewordpress url change

5. WordPress Relocate Method:

  • Edit the wp-config.php file.
  • Insert the line of code:
define('RELOCATE',true);
  • Save  wp-config.php file.
  • Access wp-login.php directly from Web Browser.

For example, if your new site is at http://www.yourdomainname.com, then type http://www.yourdomainname.com/wp-login.php into your browser’s address bar.

  • Login as you would normally do.
  • Look in your web browser’s address bar to verify that you have, indeed, logged in to the correct server. Navigate to Settings > General and verify that both the address settings are correct. Remember to Save Changes.

Remove these lines from the wp-config.php file after the site is back and running!

Conclusion:

These are the methods you can use to Change the WordPress URL of a Website. If you broke the site while configuring the URLs, then follow the steps and easily undo the faulty change to get the site back and running. Choose any of the methods from above which seems easy and simple to you.

All the methods are tested to be working and Don’t worry if you still can’t find whats wrong or Need Additional Help….Just Comment below and we are there for you.

BONUS: Change the WordPress Login URL

Admins access their WordPress Website from the /wp-admin URL. But how to Change the default Login URL so that nobody can try to log into our Website but only Us. Yes we can Change the Login URL to something unique and improve the security of our Website.

hide wordpress login url

Seems complicated, well it isn’t just Install a simple Plugin and you are done.

  • Install the WPS Hide Login plugin.
  • Go to Settings > General.
  • Change the URL to something unique and Remember it.
  • Done!

hide wordpress login url

If you try to access the default login URL after setting up the new URL, a “This has been Disabled” Error will be showed.The plugin is having more than 90,000 active installs and is rated 4.8 which shows the quality of the plugin.

About the author

adithya

Founder of Tech Tips Hacks-a blogging and technology tips and tricks website. A passionate blogger who likes to write about technology and blogging and share the knowledge among the fellow readers. I love anything tech!
Yeah that's pretty much all.....Would like to hear from you guys, come say Hi!

1 Comment

  • Wow that was strange. I just wrote an incredibly long comment but after I clicked submit my comment didn’t show up.
    Grrrr… well I’m not writing all that over again. Regardless,
    just wanted to say great blog!

Leave a Reply