地址更改后更新URL路径

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了地址更改后更新URL路径相关的知识,希望对你有一定的参考价值。

If the official codex approach (http://codex.wordpress.org/Changing_The_Site_URL) is causing you problems, give this a try. Be sure to change the constant declarations and modify table names as necessary for your instance. Confirmed working with WP v3.4.
  1. SET @current_path='site.dev.example.com',
  2. @new_path='site.stage.example.com';
  3.  
  4. UPDATE wp_posts SET post_content = REPLACE(post_content, @current_path, @new_path);
  5. UPDATE wp_posts SET guid = REPLACE(guid, @current_path, @new_path);
  6. UPDATE wp_options SET option_value = REPLACE(option_value, @current_path, @new_path);
  7. UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, @current_path, @new_path);

以上是关于地址更改后更新URL路径的主要内容,如果未能解决你的问题,请参考以下文章