How to Easily Change the Domain Name in WordPress

Sometimes when websites launch, they don’t seem to take off very well. And a dozen things can be the reason why. One of the more common culprits is choosing a bad domain name for your WordPress website. Luckily, you can change it.

If the domain is difficult to remember, hard to spell, too long, or just doesn’t reflect the kind of website you run, well, you’re going to have a hard time growing. That’s why many websites end up having to switch their domain name.

Of course, you could just be rebranding your website. But whatever the case, switching a domain name is actually more complicated than most web developers realize. And if you do it wrong, you could cripple your website.

There are really two ways to go about it. The first is to manually edit your database and replace the domain name throughout the tables, which isn’t feasible for most.

The second is to use a plugin that does this for you.

We will show you how to use the Go Live Updates Urls plugin to do just this and the other steps you need to take.

When Should I Change My Domain Name?

As you may have guessed, changing your domain name is a huge undertaking. It is also extremely risky as doing so can damage your website’s SEO if handled incorrectly. So, what situations call for such drastic action?

Well, the first one is if your domain name does not reflect your business or its values. And this happens to be the most common reason a domain name is changed.

For instance, imagine you started an online blog that covered several topics.

After several months, you notice that blogs focusing on green energy perform really well. Naturally, you choose to focus your efforts on those. Eventually, that’s all your website is producing.

Your initial blog name doesn’t reflect what you focus on, thus, it needs to be changed to match the new focal point.

A much simpler example is if you started off as a .net website and want to switch to a .com.

That’s just two examples. You could merge with another business or blog, switch your business style (i.e going from a blog to an eCommerce platform), or do something else entirely. Of course, sometimes you really did just pick a bad domain name.

A bad domain name that is difficult to type and remember can tank you fast, even if you create great content with it. However, most websites fail before they ever take a look at the domain name, thus, you need to stay vigilant.

In any event, the decision to change your domain name should not be taken lightly.

How to Change A Domain Name in WordPress

There are several steps you must carry out to change your domain name. It is a massive undertaking, but with the right prep work and know-how, you can get through it without much trouble.

Without further ado, let’s begin.

Important Note: To ensure a smooth transition between domain names, you are going to need to keep your old domain name active to set up redirects (see step 5). Thus, be sure to not cancel your web hosting account for the old one.

Step 0: Create A Backup

As you might imagine, switching from one domain to another involves a good amount of work. It’s not hard, but there are a lot of little things to look out for.

If something does go wrong when you change the domain name in WordPress, you will want a backup of your website.

This ensures if something goes wrong, you can restore your website to the way it was before. It’s an added layer of security.

There are several ways to create backups in WordPress. The first would be through your cPanel. You can also try one of the many amazing backup plugins WordPress has to offer.

I do not recommend going through this process without a backup.

Step 1: Purchase A New Domain Name for WordPress

Obviously, if you are changing your domain name, that means you are going to actually need to purchase another one. It is not as simple as just picking a new name. There are multiple ways to go about this.

However, the easiest method is to just go directly through your web host. Assuming that the desired name is not taken, you should have no problem purchasing a new domain name.

If it is taken, you either need to brainstorm it again, or try to purchase that domain name from whoever owns it, which can be quite costly.

Now, depending on where you acquired your domain name, you need to add it to your web hosting account. If you bought it from your web host, it is probably already added to your account, but that varies by web host.

If not, you will have to tell the web host what the domain name is so they can add it.

Add a new WordPress domain name

Simply follow the directions your web host provides, and soon enough, you’ll have a new domain added to your web hosting account. For additional support, don’t hesitate to contact support to provide assistance.

Step 2: Transfer Your Website to the New Domain Name

So, now that you have a new domain name and it has been added to your web hosting account, you need to take a few minutes and transfer your existing website to it. The main advantage of this is that your website will still be intact on the old domain.

This gives you some security in case something goes wrong. Think of it like having a backup for your website. Luckily, it’s actually pretty easy to copy a website from one domain to another.

Now, there are quite a few ways to go about this that include:

  • Using A Backup to Restore Your Site On the New Domain
  • Copying Your Website Files and Pasting Them In the New Domain
  • Using A Plugin to Migrate Your Website From One Domain To Another

My personal recommendation would be to use a plugin like All-in-One WP Migration. It’s a really simple plugin that has over 5 million active installs. This tool makes it very easy to migrate your website from one location to another.

This could be from one web host to another, or in our case, from one domain to another.

Step 3: Install Go Live Update URLs

At this point, you should have a new domain ready for use with your website copied from the old domain to the new one. However, since it is a copy, that means all of the information it contains is for the old domain name.

Essentially, we need to replace every URL with the updated domain. And if we were to do this manually, could take a very long time, which is why we are opting for the Go Live Update Urls plugin.

Using it is simple, so begin by installing it on the new domain.

In the left column navigation, mouse over the “Plugins” link and click the “Add New” link.

mouse over the "Plugins" link and click the "Add New" link

In the available search box, enter Go Live Update Urls. This will pull up additional plugins that you may find useful.

search for the WordPress Go Live Update Urls plugin

Locate the Go Live Update Urls plugin. Once you have located the plugin, click the “Install Now” button.

click to install the WordPress Go Live Update Urls plugin to change the domain name

Once the installation process is finished, click the “Activate” button.

click to activate the WordPress Go Live Update Urls plugin

Step 4: Change the URLs to the New Domain in WordPress

Using the plugin itself is actually pretty straightforward. The purpose is to change your WordPress site URL, thus you need to tell it the old one and enter the new one. After that, the plugin will update your database accordingly.

Note: You should still have your website intact on your old domain. This will act as a backup as making changes to the database is risky. If something does go wrong, you can copy the website from the old domain to the new one again.

On the left-hand admin bar, click on Tools and select the Go Live option.

click the "Go Live" link

You’ll see a warning, “Like any other database updating tool, you should always perform a backup before running.” Luckily, we already have the website stored on the old domain, thus, we already have a backup in place.

Alternatively, you can make a database backup using cPanel, or a standalone tool like MySQL Workbench.

With all of this said, the odds that this plugin fails are extremely low but better safe than sorry.

There’s not much to the configuration in the free version of the plugin. All of the “WordPress Core Tables” should be pre-selected. What this means is that all database tables can be written by the plugin.

"WordPress Core Tables" should be pre-selected

Scroll down and you will see two text boxes. One is to enter your Old URL and the other is for the New URL.

enter the old and new URLs

And just to be clear, only enter the full domain name itself into each box. You don’t need to enter anything beyond that.

Once that is taken care of, click the “Update URLs” button.

click the "Update URLs" button to change the domain name in WordPress

And that’s it. Congratulations, your URL has been changed throughout your new domain. Go through the pages and links on your website to ensure that everything is working as intended.

Step 5: Set Up A Redirect From the Old Domain to the New One

While you have accomplished your goal to change the domain name in WordPress, you are not done. You see, there are probably links outside of your website that lead to posts and pages from the old domain.

You need to set up a 301 redirect from the old domain to the new domain. And just to be extra clear, that redirect should be set up on your old domain, which means you should keep that account open for several months.

This will give users and search engines ample time to update links and backlinks.

The good news, there are a lot of excellent redirection plugins you can choose from. Feel free to use one of them, but I would recommend just using the .htaccess file from the cPanel.

All this entails is just opening the file and adding two lines of code that swap the old URL with the new one.

When you open the .htaccess file, just add the following lines to the top of the file and swap out the “http://domainname.com” with your new domain name:

RewriteEngine on
RewriteRule ^(.*)$ http://domainname.com/$1 [R=301,L]

And that’s it. Any time your old domain is accessed, it will be redirected to your new domain. Again, you’ll need to keep your old domain active for some time, but it’s necessary to ensure a smooth transition.

FAQ

What Else Can I Do to Ensure A Smooth Transition?

One of the first things you should do is submit an XML sitemap to Google.

From the eyes of a search engine, your new domain is a clean slate. If you want it to get ranked quickly, you need to ensure that Google has your sitemap to help map your new domain in WordPress for search bots to crawl.

Failure to do so can make the process take longer than normal. Clearly, this is not optimal, thus presenting the sitemap directly to Google is the best course of action you can take once your new domain goes live.

Just make sure that the old domain has the 301 redirects set up first. Otherwise, your new domain could appear as duplicate content.

It’s also worth pointing out that you should take a few minutes to review any automatic processes you had set up. For example, if you have WordPress set up to update automatically, you may have to set that up again.

Can I Use A Subdomain As An Alternative?

It depends on what you are trying to accomplish.

If your goal is to rebrand your website, then no. A subdomain will still contain the original domain name, thus it doesn’t work well. For example, if your domain name was http://domain.com, then the subdomain would be http://subdomain.domain.com.

The point of the subdomain is to create a separate website using that same domain name. For instance, if you had a blog called http://booktime.com, you could create a subdomain that focused on manga that would be http://manga.booktime.com.

Think of a subdomain as simply an extension of the niche for your primary website.

The subdomain has its uses but if your goal is rebranding, it is not a good option.

Should I Update Links Outside of WordPress?

Absolutely!

Odds are you probably have a Facebook, Twitter, Instagram, or another social media account for your website. You should go through these accounts and update any URLs pointing to your old domain name.

While the redirect will ensure they end up on the new domain name, you are essentially promoting the old domain name. Thus, this should be one of the first things you do when the new domain is up and running.

Of course, you may also have links on other sites from collaborations, affiliate deals, and whatnot. Try to ask if these sites can update the links for your website accordingly. You want people to associate your website with the new domain name.

That means you want to eliminate all of the traces and paths to the old one.

Does Everything Transfer Without Issue?

While I would like to say yes, the truth is that some things don’t transfer perfectly.

While all of your posts, pages, image URLs, excerpts, post metadata, custom post types, widgets and widget data, and site settings will work, the free version of the plugin doesn’t update database tables created by plugins or update serialized data.

What that means is that some plugins may not be working correctly because the database tables did not transfer or could not be altered by the plugin. In these cases, you simply need to uninstall the plugin and reinstall it on the new domain.

The good news is that this shouldn’t impact most plugins, but more complex ones will need to be reset. And remember that you can use the old domain as a reference to get everything back in order.

What If Something Goes Wrong?

As you can see from the above steps, there’s actually quite a lot to do if you want to change the domain name in WordPress.

As such, it’s very possible something could go wrong. If this happens you should use a backup of your website to restore everything to the way it was, but be sure to take a moment and see what went wrong and attempt to troubleshoot first.

Sometimes it can be something very simple such as a checkbox getting unchecked or needing to reset a plugin, or re-enter an API key. If you have no idea what went wrong, I strongly suggest reaching out to your web host.

Their support team should be more than capable of helping you solve any problems that arise. If not, consider switching to a better web host.

This is a prime example of the importance of backups as well as keeping your old domain active until the new one is working correctly.

Don’t Change Your WordPress Domain Name Lightly

As you can see from this guide, it’s not that hard to change your domain name in WordPress, but you should not do so lightly. It will have a severe effect on your SEO and could take months before you are back to normal.

And that’s if you do everything right. If you mess things up like forgetting to set up 301 redirects, well, you’re going to have a real problem. Thus, you should only change your domain name after a lot of consideration has gone into it.

Try to exhaust all other avenues before switching the domain name. It really should be a last resort.

Why did you want to change the domain name your WordPress website uses? Did switching your domain name have a positive impact on your website?

The post How to Easily Change the Domain Name in WordPress appeared first on GreenGeeks.

版权声明:
作者:倾城
链接:https://www.techfm.club/p/39096.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>