doucaigai7176 2013-11-20 11:48
浏览 110
已采纳

恢复旧的WP安装,重命名为wp-content ...恢复上传链接?

Expertise level: medium-low; I'm not afraid to find a file and edit it, but I don't really understand the inner workings of PHP.

I'm trying to restore a WP blog from backup, but with a fresh 3.7.1 install and a lot more attention to security after a hacking incident. Among other things, I've used Better WP Security to rename the wp-content folder.

My steps were:

  1. Install 3.7.1,
  2. Import the database,
  3. Activate Better WP Security, rename wp-content,
  4. Pull the old theme into the themes folder.

The database restore went fine, and the site is about 90% there, but nothing that linked to the old uploads folder in wp-content is linking now.

I've searched and replaced all of the instances of wp-content on the site using an FTP program and Sublime Text, but I'm still not getting any re-linking. Images are still being sought with generated HTML that looks for things like http://foo.com/wp-content/uploads/2012/12/pants.jpg.

Where else do I need to look for and replace wp-content to the new content folder name? I've tried poking around in the database but I have no idea where to look or what to look for.

  • 写回答

2条回答 默认 最新

  • douzhang3822 2013-11-20 12:26
    关注

    I've never used Better WP Security, but if you need to update references to wp-content in the database, the best way to update the database is the Search and Replace for WordPress Databases Script mentioned in the Codex. Don't just try updating the database manually - if the fields contain PHP serialized data (a lot of them do) you'll break things.

    Sounds like you already have a database backup, so you should be safe just to give the script a try. The search and replace values will depend on how Better WP Security works, but if the directory is just renamed (to, say, newname), using /wp-content/ and /newname/ should do the trick.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?