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 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?