简体   繁体   中英

Issues with Wordpress URL

I've installed wordpress on two websites on 2 different domain.

  1. xyz.com
  2. 123.com

Both website has installed the same version of wordpress.

Now, I've moved all the files of xyz.com to 123.com and changed the URL from 123.com to xyz.com from wordpress settings.

But there is still showing base URL as 123.com .

How can i replace the URL permanently to xyz.com ?

Thanks

Here are the steps you can follow:

1) open phpmyadmin or any other mysql client.

2) open wp_options table.

3) search for siteurl & home and change the url there.

4) dump sql file and search replace any occurrences of that url to new url, and then upload new changes. (make sure you have the backup of sql dump).

You are done..

You didn't mention about exporting your wordpress database from xyz.com to 123.com. you should have search for xyz.com and replace it with 123.com before importing database to 123.com

like datas in wp_options

siteurl,home should also be replace with 123.com and some other datas inside the database that contains xyz.com should be changed to 123.com.

Steps how to manually Change all the links

  1. Export your 123.com database using phpmyadmin
  2. Open sublime or any text editor you have and open the sql file you have exported in step 1.
  3. In sublime you can click Find then select Replace 在此处输入图片说明

  4. search for 123.com and replace with xyz.com

  5. Click Replace All then save the sql file
  6. Go to xyz.com's phpmyadmin and import the sql file you saved in step five.

You could also use Better Search Replace Plugin

Note

Always Be Careful and always make your database backup.

Here you'll find everything you need:
https://codex.wordpress.org/Moving_WordPress

Like Sagar Guhe allready said, you can change the URL in your database.
Database name and authentification are set up in the config file in the root directory of wordpress in case you need to change that.

  • Take export of the database 123.com in dreamweaver , sublime, notepad++ or any text editor.
  • In the .sql file find "siteurl" and the url which looks like 123.com replace it with the desired url that is xyz.com do find and replace
  • Then upload the newly updated database and change the configuration of wordpress files of xyz.com located in the root folder named as wp-config.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM