将Wordpress数据库更新到新域

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了将Wordpress数据库更新到新域相关的知识,希望对你有一定的参考价值。

If you've got a Wordpress install that's changed domain or you're making a local or development copy, you'll need to update the Wordpress DB tables with the new URL. The first step is the options table, with siteurl and homeurl. The posts also store the URL, but if the main options are correct WP will figure it out, though I update them too just in case.
  1. -- change wp_ to your database's table prefix
  2. -- change oldurl, newurl
  3. -- oldurl is the one in the database already
  4. -- newurl might be your localhost or development address
  5.  
  6. UPDATE wp_options SET option_value = REPLACE (option_value, 'http://oldurl','http://newurl');
  7.  
  8. UPDATE wp_posts SET guid = REPLACE (guid,'http://orldurl','http://newurl');

以上是关于将Wordpress数据库更新到新域的主要内容,如果未能解决你的问题,请参考以下文章

sql 将Wordpress移动到新域

sql 用于将WordPress网站移动到新域的SQL查询

移动到新域后,Woocommerce 产品和类别无法显示

WordPress 重定向插件,用于在目标 URL 中包含查询参数

htaccess:将所有域(https和http)重定向到新域

将所有请求从旧域重定向到新域