Wednesday, May 18, 2022

How To Change Your WordPress Domain

Don't Miss

Detect And Change WordPress Address With Relocate

How to Change Your Domain Name in WordPress 2018

If youre having issues accessing your WordPress dashboard, you can have WordPress automatically try to figure out what the correct WordPress Address should be using the RELOCATE flag in your wp-config.php file.

With the RELOCATE flag set, WordPress will automatically update your WordPress core files path to the URL used to attempt to access the wp-login.php script. This only affects the WordPress dashboard and not the site itself.

  • Edit your wp-config.php file.
  • At the top of the file add a define line:
    define 
  • Now visit your https://www.example.com/wp/wp-login.php page in your web browser.

    Be sure to type in the path of your WordPress core files before wp-login.php

  • Log into your WordPress dashboard as you would normally.
  • If you navigate to Settings > > General, you should now see that WordPress has automatically populated the WordPress Address field for you, with the path to your WordPress files.
  • Looking for more guides? We have over 400 WordPress How To Articles to help you!

    InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

    How To Change Your Domain Name On WordPress

    With more than 366 million domain names already registered online, it can be intimidating to start the process of changing your own domain name.

    For one thing, you might have a hard time finding another unique domain name. And, if you aren’t entirely sure of how to do it correctly, you could damage your WordPress site’s SEO or even completely lose your content.

    It’s important to know all the steps to changing a domain name before you get started, from choosing a new domain name to backing up your website to redirecting URLs.

    Follow along for a step-by-step guide on how to change your domain name on WordPress.

    Scenario : Moving Content From A Subdirectory

    Heres a situation where you may have placed all, or a portion of your website, on a subdirectory. However, some subdirectories begin getting more attention than whats on the primary domains page.

    Therefore, the website owner might decide to shift all content from the subdirectory to the homepage URL.

    An example of this would be:

    • Shifting from myexamplesite.com/blog to myexamplesite.com.
    • Moving from blog.myexamplesite.com to myexamplesite.com.
    • You may also consider moving from the primary domain to a subdirectory.

    The primary, or parent, domain is situated as the face of your website. This tends to be one of the most common reasons to change the WordPress URL, considering some subdirectories become super popular and should become the main page.

    Also Check: How Much Should A Domain Name Cost Per Year

    Change WordPress Url In Wp

    The second most common way to change your WordPress URL is in your wp-config.php file. It is important to note that values in wp-config.php override the settings in your WordPress admin screens.

    If the fields arent editable , it is most likely because they are hard-coded in this file.

    General settings URL grayed out

    The wp-config.php file is typically 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 somewhere above the line that tells you to stop editing:

    define define 

    Save your wp-config.php file and close it.

    When you go to the General settings screen in your WordPress admin, youll see that those two fields are now grayed out. You cant edit them unless you remove those two lines from wp-config.php.

    If you want access to those settings in your dashboard again, all you need to do is remove them from your wp-config.php file.

    How To Change Domain Name On WordPress

    How to change your WordPress Domain?

    Want to change the domain name of your WordPress website but dont know how?

    Look no further my friend. Youre in the right place!

    It doesnt happen often, but occasionally, a client decides they want to change their domain name after I have setup their WordPress website.

    Other times, I get requests from readers of The Blog Mechanic who are rebranding their business and want to hire me to change their website URL.

    The process is actually pretty simple when you know how

    But changing the URL of any site can have a negative impact on your SEO rankings, so it must be done properly.

    In this tutorial, Ill show you how to change your domain name, the right way, step by step.

    Read Also: Gulftel Webmail Login

    Changing The Url Directly In The Database #changing The Url Directly In The Database

    If you know how to access phpMyAdmin on your host, then you can edit these values directly to get your site up and running again.

  • Click the link to your Databases.
  • A list of your databases will appear. Choose the one that is your WordPress database.
  • All the tables in your database will appear on the screen.
  • From the list, look for wp_options. Note: The table prefix of wp_ may be different if you changed it when installing.
  • Click on the small icon indicated as Browse.
  • A screen will open with a list of the fields within the wp_options table.
  • Under the field option_name, scroll down and look for siteurl.
  • Click the Edit Field icon which usually is found at the far left at the beginning of the row.
  • The Edit Field window will appear.
  • In the input box for option_value, carefully change the URL information to the new address.
  • Verify this is correct and click Go to save the information.
  • You should be returned to your wp_options table.
  • Look for the home field in the table and click Edit Field. Note There are several pages of tables inside wp_options. Look for the> symbol to page through them.
  • In the input box for option_value, carefully change the URL information to the new address.
  • Verify this is correct and click Go to save the information.
  • Create A Sitemap For The New Domain

    A sitemap, or sitemap, is the file Google uses to understand your site information , so it is critical that it be available in your database. To create a file like this in WordPress, you can use a tool like XML Sitemaps Generator or .

    However, in order for the search engine to be able to read your sitemap information, you will need to verify ownership of the new domain, a procedure that can be done through Google Search Console or with the help of Google Analytics.

    Once domain ownership is verified, simply tell Google the directory where your sitemap is located.

    Also Check: Who Owns Domain Name Checker

    Copy Files To The New Domain

    To add a new domain, Log in to your Bluehost control panel. Then complete the following steps to copy files to your new domain.

    • Bluerock Account – click the Advanced tab from the side navigation menu to the left, then under the File section, click the File Manager.
    • Legacy Account – click the cpanel option from the navigation submenu at the top of your screen.Scroll down, then click File Manager under the File section.
  • Open the public_html folder.
  • Along the top of the screen, click Select all.
  • Press and hold the Ctrl key while clicking the following folders in your public_html folder:
  • .qidb
  • cgi-bin
  • addon domain folder
  • With the files still highlighted, click Copy in the top menu of the File Manager. A pop-up will open showing the following path: /public_html
  • Type the name of the addon domain folder to which you are copying the files. This box should now look similar to /public_html/addondomainname.com.
  • Click Copy File.
  • Do You Have Any Questions About Changing Your WordPress Url

    How to Change Domain Name / Website Address / URL of Your WordPress Site

    Most simple modifications only require you to go into the WordPress dashboard or wp-config.php file. Other than that, we suggest reaching out to a developer when tweaking your database or using command lines.

    Finally, you can also change the URL for other parts of your WordPress site. For example, we have that you might find useful.

    Still have any questions about how to change your WordPress URL? Let us know in the comments below.

    Free guide

    You May Like: Transfer A Domain To Squarespace

    Change All The Links From The Old Domain To The New One

    Now that you have successfully changed your domain name, you need to update your website. All the references to your old domain need to be changed to your new one. This includes references in button links, menus, image links, and anywhere else the old domain appears.

    Fortunately, this can be done fairly quickly in most cases if your site uses a database.

    You can search the database for every instance of the old domain. Then, you can enter the new one and replace all instances of it all at once.

    If you dont have access to your database, but you have access to your sites files, you can update all references to your old site address manually. Although, this can end up being quite time-consuming.

    How To Change WordPress Url In All Scenarios

    Important: This is a big change, so wed highly encourage you to back up your site before implementing any of these methods. That way, youll always have a working copy in case something goes wrong.

    After examining the reason you may want to change your WordPress URL, now its time to walk through the process of doing so. Luckily, there are a handful of methods to get the job done.

    Read Also: What Is The Io Domain Used For

    Verify The Profile #verify The Profile

  • In your Administration > Settings > General panel, you will verify that the changes you made in Changing the URL above, are correct.
  • Verify that the reference in your WordPress Address contains the new address.
  • Verify that the reference in your Site Address contains the new address.
  • If you have made changes, click Save Changes.
  • Want To Know How We Increased Our Traffic Over 1000%

    Changing Your WordPress Domain Name

    Join 20,000+ others who get our weekly newsletter with insider WordPress tips!

    Accessing phpMyAdmin in MyKinsta

    Editing and manipulating database tables directly from phpMyAdmin could break your site if not done correctly. If you are not comfortable doing this, please check with a developer first. And make sure your site is backed up before you edit your database.

    In phpMyAdmin, click on your database on the left-hand side. Then scroll down and click on the wp_options table. If your database has a different prefix it might be named slightly differently, such as wp56_options.

    phpMyAdmin wp_options table

    Then find the site url and home fields. Double click in the option_value field for each and type in the new URL.

    phpMyAdmin editing URL

    Your changes will automatically be saved.

    Recommended Reading: Squarespace With Godaddy

    Update Google Analytics And Google Search Console

    The next step is to update your Google Analytics profile. If you arent using on your site, you should be as this is by far the best free way to analyze traffic, patterns, and conversions on your site! The easiest way to do this is to click into Admin, go to your Property Settings and update the default URL. The reason we recommend simply changing your existing property rather than creating a new one is that it makes it much easier to compare history and traffic down the line .

    Update Google Analytics profile

    Reconnect Google Search Console

    Below on that same page, youll also want to reconnect your Google Search Console profile to Google Analytics. Simply click on Adjust Search Console and follow the steps. This allows for extra data to flow through into the Acquisition > Search Console section in Analytics, such as Landing pages, Countries, Devices, and Queries .

    Reconnect Google Search Console and Analytics

    How To Easily Change The Domain Name Of A WordPress Site

    If you are a webmaster of a WordPress site, I imagine that you were or might be in a situation where you would have to switch from one domain name to another without changing the content of the site itself.

    This can happen if you change the brand of your website to another name or if you simply change the domain extension, say from .net to .co.uk, to localize your website for your target audience.

    Also Check: Transferring Domain To Squarespace

    Create A New Site Clone Or Update Existing Site Address

    Once you have a backup of your site, the next step is to update your WordPress URL and site address. There are a few ways you can approach this.

    Option 1 Create New Site/Account

    Your first option would be to create an entirely new WordPress install with your new domain and then migrate your data over. You would then change the domain after the fact. Why this approach? Sometimes people prefer to leave their old site intact for a while as another backup. Or perhaps you are also moving to a new WordPress host in the process as well.

    In this case, you would simply create a second site. If youre a Kinsta client you would want to add a new install and ensure that your new domain is set as the primary domain. You can then migrate a copy of your WordPress site over. Check out our in-depth tutorial using the WordPress Duplicator plugin.

    Kinsta primary domain

    Option 2 Kinstas Clone Feature

    If youre a Kinsta customer, you could go an even easier route and to utilize our one-click clone feature. This allows you to instantly create a copy of your existing WordPress site into a second account.

    Clone WordPress site

    Option 3 Update Existing WordPress URL and Site Address

    The third and final option would be to simply update your existing sites WordPress URL and site address. You would still need to follow these steps, even if you created or cloned a new site above.

    Update WordPress address and site URL

    Update The Database Tables

    CHANGE the DOMAIN NAME on your SITEGROUND WordPress Website

    Once the domain is working, and you can log in to the WordPress Dashboard of the new site, install the Search and Replace plugin. It will allow you to search all of the tables in the database, search for your old domain, and replace each instance with your new domain. You can uninstall the plugin after the tables have been updated. In addition to the database, you should check your site for any links hard-coded into widgets, etc. Those links will need to be manually edited to reference your new site address. For additional information on using this plugin, please review the following article:

    Don’t Miss: Connecting Godaddy Domain To Squarespace

    Purchase A New Domain Name

    First and foremost, head to Hostingers domain checker and type in your preferred domain. Youll find out if your option is available, and get some suggestions on a few alternatives as well as domain costs.

    From there, add your domain to the cart, and proceed to check out. Then register it to ensure its active.

    You can also get free domain registration for the first year if you purchase Hostingers annual Premium or Business.

    Edit The Database Through Phpmyadmin

    Before making any changes to your database, be sure to back it up in cPanel or whatever control panel youre using.

    Navigate to phpMyAdmin and find your WordPress database listed in the column on the left. Click on the database name to select it. Youll see a list of tables appear below the database name. Find the table called wp_options and click on it. There are two rows inside of this table that you need to edit: siteurl and home. These should appear as the first two options. Edit these values to reflect your target domain, and youre done!

    You May Like: Squarespace To Godaddy

    More articles

    Popular Articles