banner



How To Change Primary Domain On Wordpress

There are times when you'll demand to move a WordPress site to a new domain. You might want to motion your site to a new hosting provider, or y'all might just desire to change the domain proper noun. In this post you'll learn how. Information technology's easier than you lot might think!

The proficient news is that in nearly instances, moving a site to a new domain doesn't really hateful you take to physically motility the site. Instead, you can alter the WordPress settings so your site behaves equally if it's moved domains. But it still stays where information technology is on your server.

Sometimes, moving your domain name will too mean moving your site. Possibly y'all desire to find a better hosting provider. Or maybe you want to move your site into or out of a multisite network. In that case, you'll need to drift the site also every bit setting up the new domain.

In this tutorial, I'll help you identify whether you demand to physically move your site or not, and and so evidence you how to move your site to a new domain, both if you need to migrate the site and if you don't.

So let's get started.

Moving to a New Domain Name: Practise You Need to Migrate the Site?

In most cases, moving your WordPress site to a new domain name can exist done without physically moving the site.

But sometimes you'll either need or want to migrate the site as well. Here are some scenarios in which that might be the case:

  • You want to redesign your site at the same time and change to a more suitable hosting plan.
  • You're unhappy with your hosting provider and want to switch.
  • Your site is currently in a multisite network, and y'all desire to motion information technology to a standalone site.
  • Your site is a standalone site, and you want to movement it into a multisite network (too every bit changing the domain).

In these cases, you'll demand to drift the site also as changing the domain name. I'll show yous how to practice that before long. But start, allow's look at how you live to a new domain name without actually moving the site.

Switching Domain Names Without Moving Your Site

Changing your domain proper noun is a lot simpler than you might think. And you lot can practise it by tweaking your WordPress settings and running a search for the old domain proper noun in your database, using a plugin.

There are three steps:

  • Annals the new domain proper name and signal information technology at your site.
  • Configure the WordPress settings to use the new domain name.
  • Edit the database or prepare redirects and then that internal links to your old domain name are replaced past links to the new i.

Allow'southward work through these steps.

Register the New Domain Name and Point It at Your Site

If y'all desire to use a new domain name, the first pace is to register information technology. Cheque that it's available and, if and then, register it under your name.

If your hosting provider likewise registers domain names, information technology'southward simpler to do this with them—that fashion, you lot know your new domain proper noun will signal at your site.

But if your hosting provider isn't also a domain registrar, or if you've also registered the domain name elsewhere, you'll demand to become information technology pointing at your site.

Check how yous do this with your domain registrar. You'll need to modify one of the following:

  • Nameservers: This volition make all aspects of your domain name point to your hosting provider, including email addresses. And then if you already have electronic mail ready using your domain name, you'll either need to fix that upwards again with your hosting provider, or use a unlike option. I tend to employ nameservers and then direct email at Gmail using MX records.
  • A records: Use this to point your domain proper name at the IP address where your website is hosted. Your hosting provider will exist able to give you this.

Once you've washed that, your domain name will indicate to the right place, although information technology can take anything upwardly to a couple of days to work. You tin utilize WhatsMyDNS to check if your DNS changes take propagated around the internet.

WhatsMyDNS WhatsMyDNS WhatsMyDNS

Your domain name is at present pointing at your site, simply your site volition still behave as if it'southward using the one-time domain name. And so yous demand to configure some settings.

Configure Domain Settings in WordPress

In the WordPress admin, get to Settings > General. Look for the WordPress Accost and Site Address fields. Edit these and so they accept your new domain name instead of the onetime one.

General settings General settings General settings

Coil downward and click the Save Changes button to save your new domain proper noun. Your site volition now work on the new domain name.

Your site is now using a shiny new domain name, but there could still be a problem, and that's links.

Redirect Links Using the Old Domain Proper noun

If yous've shared links to your site using the onetime domain name, anyone using that link will merely be taken to the new site if y'all still have your one-time domain name pointing at information technology (which you should). And even if that's the instance, they won't be taken to the right page in the site—they'll either discover themselves on the dwelling house page or the 404 page.

And then any important links need to take redirects fix. Install a redirection plugin like the gratuitous Redirection or the more than full-featured premium Advanced WP Redirect plugin and create redirections from the relevant posts or pages using the quondam domain proper name to those using the new domain name.

Alternatively, you tin set up a wildcard redirect from the old domain name to the new one, using a plugin or using cPanel in your hosting provider'southward dashboard. This will catch whatsoever quondam links and ship them to a link with the same slug using the new domain proper noun.

With the redirection plugin, you can prepare upwards a wildcard redirect, which volition redirect all slugs using your erstwhile domain proper noun to the same slug on your new domain proper noun. This ways you accept to keep the slugs for your posts the aforementioned when yous change domain names, and that y'all mustn't change the URL structure of your permalinks. If you just leave everything as it is, you won't go wrong.

You'll need to enable regex functions offset, as the wildcard asterisk is a regex function.

Go to Tools > Redirection and get to the Add together new redirection department of the screen.

Creating a new redirect rule with the redirection plugin Creating a new redirect rule with the redirection plugin Creating a new redirect rule with the redirection plugin

Click on the URL Options/Regex drop-downwardly and check the Regex box.

Setting up a wildcard redirect with the Redirection plugin Setting up a wildcard redirect with the Redirection plugin Setting up a wildcard redirect with the Redirection plugin

In the Source URL field, type the old path with a wildcard. It needs to take the form /(.*)$. The entry for Target URL needs to accept the form /$ane.

Click Save Changes to save your redirect settings.

Remove Internal Links Using the Old Domain Name

Redirects work for links yous've shared externally. But for links internal to the site, in that location'due south a better fix, and that's to edit those links to point to the new domain proper noun.

Install a plugin like Better Search Replace and use it to replace all instances of the sometime domain proper name in your database with the new domain name. This means whatsoever internal links in your mail or page content or in widgets will be updated to reflect the new domain name.

Before yous do this, yous should always support your database. This process involves directly editing the database, and if you do it wrong, it'll be difficult to disengage. And so use your backup software of selection to brand a backup and relieve it somewhere safe.

And so go to Tools > Better Search Supplant to access the plugin screen.

Better Search Replace screen Better Search Replace screen Better Search Replace screen

In the Search for field, type in your old domain name. In the Replace with field, type in your new domain proper name. It's a good idea to include the https:// or https:// so y'all don't discover yourself replacing instances of email addresses that haven't inverse. If y'all practice, brand sure you lot exercise it for both the search and replace fields.

Notation: When you lot set up your new domain proper name, information technology'southward good practice to add SSL to your site then information technology's at https://yourdomain.com. Set this up before running a search and replace and use https:// in the supersede field. Learn how to set upwardly SSL with our free guide.

Next, you can select the tables yous desire to search. Either go out this at all tables, or select the wp_posts table to supplant instances of your domain in your posts and pages—this usually picks upward everything you need.

Keep Run as dry run checked then you tin test things before editing your database (non something you should do lightly).

Click the Run Search/Replace button to run the search. The plugin volition tell you how many instances of your search term it constitute and give y'all the opportunity to run the replacement once more for real. You tin also check the list of results information technology returns. If you're happy, run the search/replace for real.

You may and so find yous take to log in to your site again because of the domain change, or that you accept to refresh your browser cache to get rid of old links in any buried pages. Exercise this and your site should exist running with the new domain proper name throughout.

1 word of alert: if there are any valid instances of the old domain name (e.1000. email addresses) in your mail or page content, you'll need to exclude these from the search replace.

Your site volition at present exist working on the new domain name—and you didn't have to physically move the files at all.

Migrating Your Site to a New Location and Domain Proper name

Merely what if you do actually need to move your site from one identify to another, equally well as moving the domain proper name?

Moving your site will have a little longer, but can exist done.

There are four possible ways to practise it:

  • Enquire your new hosting provider to run the migration for you, if you're switching hosting providers. Nearly providers volition do ane migration for free.
  • Employ an automatic tool provided by your hosting provider to run the migration, if they provide one. SiteGround, for instance, has a migration tool that you install on your old site, and it automatically moves all of your content and settings to your new site.
  • Utilize a migration plugin to drift your site from one place to another. CodeCanyon has a number of migration plugins that will practise this for you.
migration plugins on code canyon migration plugins on code canyon migration plugins on code canyon
  • Run the migration manually. This volition involve copying the files and the database as well equally installing WordPress in the new location. You can detect out how to do this in our guide to migrating WordPress manually.

If your site is moving into or out of a multisite network, this will complicate things—but not make them impossible. Yous can either use a migration plugin that supports multisite, or follow our guides to manually migrating WordPress out of a network or into a network.

Summary

Moving your WordPress site from one domain to another doesn't accept to mean moving your site at all. Instead, y'all can merely bespeak the domain name at your site and brand some changes to the settings, and you lot're washed.

But if y'all do need to physically motility your site, then it'south not and then difficult as yous may recollect. Follow the tips in a higher place, and you'll shortly have your site working on your shiny new domain proper name.

The Best WordPress Themes and Plugins on Envato Market

Explore thousands of the best WordPress themes ever created on ThemeForest and leading WordPress plugins on CodeCanyon. Purchase these loftier-quality WordPress themes and plugins and improve your website experience for you and your visitors.

Popular WordPress themes on ThemeForest Popular WordPress themes on ThemeForest Popular WordPress themes on ThemeForest

Here are a few of the best-selling and up-and-coming WordPress themes and plugins available for 2020.

Source: https://webdesign.tutsplus.com/tutorials/how-to-copy-a-wordpress-site-from-one-domain-to-another--cms-35103

Posted by: combsobjer1979.blogspot.com

0 Response to "How To Change Primary Domain On Wordpress"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel