How to Easily Update URLs When Moving Your WordPress Site

Do you want to update URLs after moving your WordPress site?

It can be pretty time-consuming to manually edit each post or page just to replace old URLs. Luckily, there are WordPress plugin that help you automate the process of updating old URLs.

In this article, we will show you how to easily update URLs when moving your WordPress site.

How to Update URLs when Moving your WordPress Site

When and Why Do You Need to Update URLs?

Let’s suppose you moved a WordPress site to a new domain name. You can then change the WordPress address and site URL by visiting the Settings » General page from your WordPress dashboard.

Changing WordPress and site URLs

However, this doesn’t change the URLs that you have previously added in your posts and pages. It also does not change the URLs of images you have added to your WordPress site.

Changing all these URLs manually in every blog post and page can be time-consuming. Plus, there will always be a chance that you’ll miss some URLs, which can lead to broken links on your website.

That’s why it’s important to update your URLs when moving your WordPress website.

It helps in providing a smooth user experience for your users, as they’ll easily find the page they’re looking for. Updating URLs also improves your WordPress SEO and allows search engines to find new content for indexing.

Last but not least, you also want to ensure there are proper 301 redirects setup from your old domain to the new domain, so users are always redirected to the right place.

This is extremely important because there are likely other websites that are linking to your old domain including social media posts, Google, and more.

With that said, let’s see how you can quickly and easily update URLs when migrating your WordPress site.

Update URLs After Moving a WordPress Site

The easiest way to update old links on your website is by using the Go Live Update Urls plugin for WordPress. It’s a free WordPress plugin and lets you update URLs in your posts, pages, images, excerpts, widgets, and more.

However, make sure that you have a complete backup of your WordPress site before updating all the links. This will allow you to easily revert back in case something goes wrong during the update process.

Next, you’ll need to install and active the Go Live Update Urls on your site. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you can navigate to Tools » Go Live from your WordPress admin panel.

Select core tables to update

After that, you can update URLs in your posts, comments, options, user data, and other areas of your site by checking the WordPress core tables options in the plugin.

WordPress core tables are where all your website data is organized and stored. For example, a wp_comments table will have all the information about comments on your site along with data about the person commenting.

Besides that, Go Live Update Urls also lets you update old URLs in the data used by different plugins on your website. However, this is an optional step and you can skip it.

Update URLs in plugin data

Next, you’ll need to scroll down to the section for updating the old links to the new URLs. Go ahead and enter the ‘Old URL’ and ‘New URL’ in the respective fields.

Enter old and new URL

Once that’s done, simply click the ‘Update Urls’ button. The plugin will now update all the URLs on your site to the new domain.

Redirect Posts & Pages After Updating URLs

After you’ve updated all the URLs on your website, you’ll now need to set up 301 redirects for your entire site to the new domain. This will preserve links from sites that were linking to your old domain and prevent 404 errors.

The easiest way of performing a full site redirect is by using the All in One SEO (AIOSEO) plugin. It’s the best SEO WordPress plugin and is trusted by over 3 million professionals.

AIOSEO offers a powerful redirection manager that lets you redirect old URLs to new ones in just a few clicks. The plugin also helps track 404 errors on your site, so you can quickly find and fix any broken link.

For this tutorial, we’ll be using the AIOSEO Pro version because it includes the redirection manager and other features like sitemaps, custom breadcrumbs, and schema markup. You can also try the free version of AIOSEO to get started.

The first thing you’ll need to do is install and activate the AIOSEO plugin on your site. If you need help, then please refer to our guide on how to install a WordPress plugin.

Upon activation, you will need to go to All in One SEO » Dashboard from your WordPress admin panel. Now click the ‘Launch the Setup Wizard’ button to configure the plugin.

Launch setup wizard from AIOSEO dashboard

All you have to do is follow the steps in the setup wizard. For more information, see our detailed tutorial on how to setup All in One SEO for WordPress.

1. Setting up Full Site Redirects

This method is super useful when you’re merging two separate WordPress sites into one, or if you’re going to setup a new WordPress install for the new domain because it’ll handle a full site redirect without adding any code.

Simply head over to All in One SEO » Redirects from your WordPress admin area and click the ‘Activate Redirects’ button.

Activate AIOSEO redirects

Upon activation, you’ll need to navigate to the ‘Full Site Redirect’ tab and enable the ‘Relocate Site’ toggle. Next, you can enter your new domain name in the ‘Relocate to domain’ option.

Full site redirect

After entering your new domain URL, don’t forget to click the ‘Save Changes’ button to store your settings. AIOSEO will now redirect all the links on your site to the new URL.

2. Setting up Individual Post / Page Redirects

AIOSEO also offers different types of redirection methods that you can use to setup individual post / page redirects. We recommend selecting the ‘301 Moved Permanently’ redirection type, as it tells your browser that the page is moved to a new destination permanently and you don’t wish to move it back.

Add redirection for old links

Once you’ve filled out these details, simply click the ‘Add Redirect’ button.

If you want to see the different redirects you’ve created, then simply scroll down and view the logs.

Redirection logs in AIOSEO

You can see the URLs, number of people that visited the link, the type of redirection you’ve set, and also choose whether to enable or disable the redirect.

In the ‘Settings’ tab under Redirects , you can choose to setup server level redirects as well which are way faster. The default method is set to PHP which is the easiest way to redirect old URLs, and it doesn’t require any server-side configuration.

But you can select ‘Web Server’ as the redirection method, and then choose either Apache or NGINX as your web server. We won’t recommend this method for beginners as it requires technical knowledge.

Select the Redirect Method

Bonus: Track Broken Links on Your Website

When you update your URLs to a new domain, it’s also essential to keep an eye on any broken links. These are links that no longer exist and show a 404 error page. They can occur if any URL didn’t get updated properly.

With AIOSEO, it’s very easy to track and fix 404 error pages using the Redirection Manager.

To begin, you can head over to All in One SEO » Redirects from your WordPress dashboard.

Next, go ahead and click the ‘Settings’ tab under Redirects and then click on the toggle to enable the ‘404 Logs’ and ‘Redirect Logs’ options.

Enable 404 logs

Using AIOSEO, you can choose the time period to keep your 404 error logs. We recommend that you select no longer than one month for smooth and optimal WordPress performance.

Once you’ve enabled these options, click the ‘Save Changes’ button at the top to store your settings.

You should now see a new ‘404 Logs’ tab appear under Redirects in AIOSEO. It’s under this tab where the plugin will track and show 404 error pages on your website.

An important thing to note is that you won’t see any data under the 404 Logs tab at first. The plugin will only start to record broken links after you’ve enabled the settings.

However, once the setting is active, go ahead and click on the ‘404 Logs’ tab. You’ll see a list of broken links under the URL column, the number of visits under the Hits column, and the last accessed date.

Click 404 logs menu option

To fix any broken link, simply click the ‘Add Redirect’ button for the respective URL. AIOSEO will now show options to set up redirection for the 404 error URL.

Go ahead and enter the new link under the ‘Target URL’ field and select ‘301 Moved Permanently’ as the Redirection Type from the dropdown menu.

Add redirect for your broken link

Next, you’ll need to click the ‘Add Redirect’ button to fix the broken link on your website.

To check if the redirection is working, simply visit the old URL. If you’re redirected to the new URL, then it means you’ve successfully fixed 404 error pages.

We hope this article helped you learn how to update URLs when moving your WordPress site. You may also want to see our comparison of the best email marketing services for small businesses, and best push notification software to grow your traffic.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Easily Update URLs When Moving Your WordPress Site appeared first on WPBeginner.

How to Move WordPress From Local Server to Live Site (2 Methods)

One way to speed up your website development is to build your website locally on your own computer using a software like WAMP (for Windows) or MAMP (for Mac).

Once you’re finished perfecting your website, the next step is to move it from your computer to a live site and share your creation with the world. In this article, we will show you how to easily move WordPress from local server to a live site.

Move WordPress From Local Server to Live Site

We will cover two different methods to move WordPress from local server to your live website (step by step).

The first method uses a WordPress migration plugin and is recommended for beginners. In the second method, we will show you how to manually move WordPress from local server to a live site.

You can choose the method that best suits you:

Before You Begin

In order for you to migrate WordPress from localhost to live server, you need to have a few things in place.

First, we’re assuming that you have a WordPress site running on local server (also called localhost) on your computer, and you have full access to it.

Next, you’ll need to have a domain name and web hosting. We have a list of the best WordPress hosting companies that you can choose from.

To speed it up, you can use Bluehost. They’re an official WordPress recommended hosting provider, and they are offering our users an exclusive 60% off discount + a free domain.

If you need help setting up your website, follow our step by step guide on how to make a website.

Finally, you will need to have a FTP program and know how to use FTP, so you can upload your content to the live site.

Ready? Let’s begin migrating your WordPress site.

Method 1. Transfer WordPress from Local Server to Live Site Using a Migration Plugin

This method is easier and recommended for beginners. We’ll be using a WordPress migration plugin to move WordPress from localhost to a live site.

Step 1. Install and Setup Duplicator Plugin

First, thing you need to do is install and activate the Duplicator plugin on your local site. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to go to Duplicator » Packages page and click on the ‘Create New’ button.

Creating a new Duplicator package

After that, click on the next button to continue.

Duplicator will now run some tests to see if everything is in order. If all items are marked ‘Good’ then click on the ‘Build’ button.

Build package

This process may take a few minutes depending on the size of your website. You need to leave this tab open until the process is complete.

Once finished, you’ll see download options for Installer and the Archive package. You need to click on the ‘One click download’ link to download both files to your computer.

Download package

So what are these files?

Well, the archive file is a copy of your complete WordPress website. It includes all WordPress core files as well as your images, uploads, themes, plugins, and a backup of your WordPress database.

The installer file is a script that will automate the migration by unpacking the archive file.

Step 2. Create a Database for Your Live Site

Before you can run the installer or upload the WordPress website from localhost to your hosting server, you will need to create a MySQL database for your live website.

If you have already created a MySQL database, then you can skip this step.

To create a database you need to visit your hosting account’s cPanel dashboard. Scroll down to the Databases section and then click on the MySQL Databases icon.

Database icon in cPanel

On the next screen, you’ll see a field to create a new database. Simply provide a name for your database and click on the ‘Create Database’ button.

Create new database

cPanel will now create a new database for you. After that, you need to scroll down to the MySQL Users section.

Next, provide a username and password for your new user and click on the ‘Create a user’ button.

Add a MySQL user

The new user you just created, still does not have permission to work on the database. Let’s change that.

Scroll down to the ‘Add User to Database’ section. Simply select the database user you created from the dropdown menu next to the ‘User’ field, then select the database, and click on the add button.

Save user to the database

Your database is now ready to be used with your WordPress site. Make sure to note down the database name, username, and password. You’ll need this information in the next step.

Step 3. Upload Files from Local Server to Live Site

Now you need to upload the archive and installer files from your local site to your hosting account.

First, connect to your live site using an FTP client. Once connected, make sure that the root directory of your website is completely empty.

Normally, root directory is the /home/public_html/ folder.

Some WordPress hosting companies automatically install WordPress when you sign up. If you have WordPress files there, then you need to delete them.

After that, you can upload the archive and installer files from Duplicator to your empty root directory.

Migration files in the root directory

Step 4. Runing The Migration Script

After you have uploaded the migration files, you need to visit the following URL in your browser:

http://example.com/installer.php

Don’t forget to replace example.com with your own domain name.

This will launch the Duplicator migration wizard.

Duplicator intialized

The installer will automatically scan for the archive file and run a validation test. You need to check the terms & conditions checkbox and continue by clicking on the Next button.

On the next screen, it will ask you to enter your WordPress database information.

Your host will likely be localhost. After that, you will enter the details of the database you created in the earlier step.

Connect your database

Click on the next button to continue.

Duplicator will now import your WordPress database backup from the archive into your new database.

Next, it will ask you to update site URL or Path. You shouldn’t have to change anything since it automatically detects the URL of your live website, and its path.

Update site URL

Click on the next button to continue.

Duplicator will now finish the migration and will show you a success screen. You can now click on the ‘Admin Login’ button to enter the WordPress admin area of your live site.

Successfully moved

Once you login to your live site, Duplicator will automatically clean up the installation files.

That’s all, you have successfully moved WordPress from local server to your live site.

Method 2. Manually Transfer WordPress from Local Server to Live Site

In this method, we will show you how to manually move WordPress from local server to your live site. It will come in handy if the first method doesn’t work or you prefer to do it manually.

Step 1: Export Local WordPress Database

The first thing you need to do is export your local WordPress database. We’ll be using phpMyAdmin to do that. If you are unfamiliar with it, then you might want to take a look at our guide to WordPress database management using phpMyAdmin.

Simply go to http://localhost/phpmyadmin/ and click on your WordPress database. Next, click on the Export button from the top menu bar.

Export from localhost

In the Export Method option, you can choose “Quick” or “Custom”. Custom will provide you with more options to export your database.

We recommend choosing Quick, and then click the Go button to download your database.

Export WordPress database using phpMyAdmin

Step 2: Upload WordPress Files to Live Site

Now we’ll need to move all your website files to the live site.

To get started, go ahead and open your FTP client and connect to your web hosting account.

Once you’re connected to your live site, make sure you upload the files in the right directory. For example, if you want the site to be hosted on yoursite.com, then you would want to upload all the files in your public_html directory.

Now select your local WordPress files and upload them to your live server.

Uploading WordPress from localhost to live site

Step 3: Create MySQL Database on Live Site

While your FTP client is uploading your WordPress files, you can start importing your database to the live server. Most WordPress hosting providers offer cPanel to manage your hosting account, so we’ll show you how to create a database using cPanel.

First, you need to log in to your cPanel dashboard and click on the MySQL Databases icon which can be found in the databases section.

Database section in cpanel

On the next screen, create a database by entering a name for your database and clicking the Create Database button.

New database

After creating your database, scroll down to the MySQL Users section and create or add an existing user to the database.

After adding the user, cPanel will take you to set MySQL privileges for that user. Simply grant all privileges to the user by making sure every box is checked, and then click the Make Changes button.

grant all privileges to database user

Step 4: Import WordPress Database on Live Site

The next step in the process is to import your WordPress database.

Go to your cPanel dashboard, scroll down to the databases section and click on phpMyAdmin.

This will take you to phpMyAdmin where you want to click on the database you created in Step 3. PhpMyAdmin will show your new database with no tables.

Click on the Import tab in the top menu. On the import page, click on Choose File button and then select the database file you saved in Step 1.

Lastly, press the Go button at the bottom of the page. PhpMyadmin will now import your WordPress database.

Import database via phpMyAdmin

Step 5: Change the Site URL

Now you need to change the site URL in your database, so that it will connect with your live WordPress site.

In phpMyAdmin, look for the wp_options table in your database that we just imported in step 4. If you changed your database prefix, then instead of wp_options it might be {prefix}_options.

Click on the Browse button next to wp_options or the link that you see in the sidebar to open the page with a list of fields within the wp_options table. See screenshot below:

Browse the wp options table

Under the field options_name, you need to look for siteurl. Click the Edit Field icon which can be found at the far left at the beginning of the row.

Edit siteurl in phpMyAdmin

When you click the edit field, an edit field window will appear. In the input box for option_value, you will see the URL of your local install probably something like: http://localhost/test. Carefully insert your new site url in this field, for example: https://www.wpbeginner.com

Save the field by clicking the Go button.

edit the siteurl field

Next, you need to replicate this step for the option name: home. The wp_options page can be a few pages long, so simply find the home tab.

Usually it is on the second page which you can navigate to by clicking on the pagination arrows in phpMyAdmin.

Update the home url to be the same as your siteurl.

Step 6: Setup Your Live Site

Now that we have imported the database and all of our content should be uploaded, it’s time to configure WordPress.

At this time, your site should be showing an Error Establishing Database Connection error.

To fix this, connect to your website using an FTP client and edit wp-config.php file.

You will need to provide the database name, user and password you created earlier in Step 3.

Next, save the wp-config.php file and upload it back to your server.

You can now visit your website, and it should be live now.

Next, you need to login to your WordPress admin panel and go to Settings » General. Without changing anything, scroll to the bottom and click the Save Changes button.

This will ensure that the site URL is corrected anywhere else that it needs to be.

After that go to Settings » Permalink and click Save Changes to ensure that all post links are working fine.

Step 7: Fix Images and Broken Links by Updating Paths

Whenever you are moving a WordPress site from one domain to another, or from local server to a live site, you’ll face broken links and missing images.

You can either use the SQL query or use the Velvet Blues WordPress plugin.

For those who want to do it via SQL, here is a simple SQL query that should solve this problem:

UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', 'www.yourlivesite.com/');

Simply go to phpMyAdmin, click on your database and then click on SQL from top menu. Write this query, but don’t forget to change it with your own local site and live site URLs.

Fixing WordPress images and broken URLs after moving to live site

That’s all, you have successfully migrated WordPress from localserver to a live site!

Hopefully now your live website is up and running smoothly. Be sure to check out your website to make sure that everything is working as expected. If you notice any errors, you can check out our guide to common WordPress errors for help troubleshooting.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Move WordPress From Local Server to Live Site (2 Methods) appeared first on WPBeginner.