• Home
  • Categories
    • WordPress Troubleshooting
    • WordPress Tips and Tricks
    • SSH (Secure Shell)
    • WordPress Insights
    • WordPress Common Facts
    • Securing WordPress
  • Series Tutorials
    • Advanced WordPress Topic
  • Privacy Policy
  • Terms of Use
  • Contact Me
  • About WP Tuts Hub
Home  /  WordPress Common Facts • WordPress Insights • WordPress Tips and Tricks  /  WordPress Replace Old URL After Domain Change
WordPress Common Facts
September 27, 2016

WordPress Replace Old URL After Domain Change

zubaer WordPress Common Facts, WordPress Insights, WordPress Tips, WordPress Tricks Leave a Comment
Share on Facebook Share on Twitter Share on Pinterest Share on StumbleUpon Share on Reddit Share on LinkedIn Share on tumblr
Email this article!

In this article, I will show you an effective way of updating domain name of a WordPress site after changing the domain. We will do it in two ways: i) Manually with SQL commands and ii) Automatically with a Plugin. I do insist on backing up your WordPress site’s database before proceeding with this tutorial.

How to Replace Old URL After Domain Change in WordPress (Step by Step):

Step 0: Before you go ahead with this step by step tutorial make sure that you have a backup of your Database.

Step 1: Login to your cPanel and Click on PHPMyAdmin.

Step 2: Select the database of your website and click on “SQL” tab.

Update WordPress site URL via PHPmyadmin

Step 4: Paste the following code into the SQL command box.

Important:

Note 1: Update the wp_ table prefix according to your website’s database table prefix. In my case, it’s “wpdb_“. So, I shall replace “wp_”  with “wpdb_“.

Note 2: Replace “OLD_WEBSITEURL.COM” with your old website domain name and “NEW_WEBSITEURL.COM” with your new domain name.

So, for my case the final codes will look like this:

update wpdb_options set option_value = replace(option_value, 'http://OLD_WEBSITEURL.com', 'http://NEW_WEBSITEURL.com');
update wpdb_postmeta set meta_value = replace(meta_value, 'http://OLD_WEBSITEURL.com', 'http://NEW_WEBSITEURL.com');
update wpdb_posts set post_content = replace(post_content, 'http://OLD_WEBSITEURL.com', 'http://NEW_WEBSITEURL.com');
update wpdb_posts set guid = replace(guid, 'http://OLD_WEBSITEURL.com', 'http://NEW_WEBSITEURL.com');
update wpdb_posts set pinged = replace(pinged,'http://OLD_WEBSITEURL.com', 'http://NEW_WEBSITEURL.com');
update wpdb_comments set comment_content = replace(comment_content, 'http://OLD_WEBSITEURL.com', 'http://NEW_WEBSITEURL.com');

Step 5: Press “GO” button and you are done.

 

Update WordPress site Domain Name Automatically with a Plugin:

For some users working directly with PHPMyAdmin can be a little trickier. No worries, there’s a nice plugin which can help you to update your WordPress website domain name easily (though I will recommend the manual method above).

You can use “Automatic Domain Changer” plugin for this purpose. After installing this plugin you will find the option for changing domain name by navigating to “Tools” >> “Change Domain“.

automatically update wordpress site domain name

Please feel free to comment below if you have any concern, issue or suggestion.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Previous Article Frequently Used SSH (Secure Shell) Commands for a Web Developer
Next Article How to Secure WordPress Site From Hacking, DDoS and Brute Force Attack

About Author

zubaer

Hi, My name is Zubaer and I am a Web Devloper. Besides, I am Hybrid Mobile App Developer. My fields of proficiency are WordPress, Laravel, HTML, CSS, JavaScript, AngularJS and PHP. You can visit www.zubaer.com to know more about me.

Related Posts

  • WP Cron - All scheduled cron jobs

    Using Cron Job in WordPress – Schedule Events With WP-Cron: Part 2

  • Secure WordPress site from hacking, DDoS and Brute force attack

    How to Secure WordPress Site From Hacking, DDoS and Brute Force Attack

Leave a Reply

Cancel reply




Popular Posts

  • Using Cron Job in WordPress - - Schedule Events With WP-Cron
    Using Cron Job in WordPress – Schedule Events With WP-Cron: Part 1 December 20, 2016
  • C Program to Store Multiple Student Records Using Structure and Pointer May 27, 2023
  • SSH Secure Shell Commands
    Frequently Used SSH (Secure Shell) Commands for a Web Developer September 7, 2016
  • Update WordPress site URL via PHPmyadmin
    WordPress Replace Old URL After Domain Change September 27, 2016

Categories

  • Advanced WordPress Topic2
  • C Programming2
  • Computer Programming2
  • Securing WordPress2
  • Series Tutorials2
  • SSH (Secure Shell1
  • WordPress Common Facts1
  • WordPress Insights2
  • WordPress Tips and Tricks4
  • WordPress Troubleshooting3

Calorie Calculator Pro

  • US Units
  • Metric Units
Please enter your age
Please enter your gender
Please enter your height
Please enter your weight (Pounds)
Please select an activity level
Your body fat percentage (optional)
Please enter your First Name
Please enter your Last Name
Please enter your best email address
Please enter your age
Please enter your gender
Please enter your height
Please enter your weight (Kg)
Please select an activity level
Your body fat percentage (optional)
Please enter your First Name
Please enter your Last Name
Please enter your best email address
Please enter your best email address
Problem? Try Another

Archives

  • May 20233
  • July 20171
  • December 20162
  • September 20162
  • July 20162

Tags

File Upload Error HTTP Error Prevent DDoS and Brute Force Attack Schedule Events Secure Shell Securing WordPress SSH SSH Commands Structure and Pointers in C Structures in C Programming Using Cron Job WordPress Administrator WordPress Common Facts WordPress Cron Job WordPress Error WordPress Insights WordPress Tips WordPress Tricks WP-Cron

My Services and Products

  • Hire Me or Contact Me
  • My WordPress Plugins and Themes
  • WeboCoder
  • Privacy Policy
  • Terms of Use
  • About Us

Subscribe

    Your Name (required)

    Your Email (required)

    Random Posts

    • Using Cron Job in WordPress - - Schedule Events With WP-Cron
      Using Cron Job in WordPress – Schedule Events With WP-Cron: Part 1 December 20, 2016
    • SSH Secure Shell Commands
      Frequently Used SSH (Secure Shell) Commands for a Web Developer September 7, 2016
    • WP Cron - All scheduled cron jobs
      Using Cron Job in WordPress – Schedule Events With WP-Cron: Part 2 July 10, 2017
    © WP Tuts Hub 2023.
     

    Loading Comments...