admin管理员组文章数量:1313120
I recently inherited a large site from a developer that vanished. The site has more than 6,000 images. In the pages most of the images are missing, however, they are referenced in the media library and I can see them on the server under wp-content/uploads. When I try to access any of these images with the blank thumbnail I get the following error message:
Missing Attachment
Given that this site has been moved to a new host I am pretty sure that these images are not properly referenced but I am not sure how to modify the path to the images to get them to show up properly. I did some research and tried the following:
UPDATE wp_posts set post_content=REPLACE(post_content, 'mysitexyz.basepointsite/', 'mysitexyz/');
What is the correct way to re-associate these images and have them appear correctly in the media library?
I recently inherited a large site from a developer that vanished. The site has more than 6,000 images. In the pages most of the images are missing, however, they are referenced in the media library and I can see them on the server under wp-content/uploads. When I try to access any of these images with the blank thumbnail I get the following error message:
Missing Attachment
Given that this site has been moved to a new host I am pretty sure that these images are not properly referenced but I am not sure how to modify the path to the images to get them to show up properly. I did some research and tried the following:
UPDATE wp_posts set post_content=REPLACE(post_content, 'mysitexyz.basepointsite/', 'mysitexyz/');
What is the correct way to re-associate these images and have them appear correctly in the media library?
Share Improve this question asked Sep 18, 2014 at 19:44 forrestforrest 4833 gold badges7 silver badges16 bronze badges1 Answer
Reset to default 7There's a few plugins to fix this, but basically it your database still references the images to be "oldsite/wp-content/uploads/" and you need it to be "newsite/wp-content/uploads"
So you have to change all old references. You could use SQL:
UPDATE wp_options SET option_value = replace(option_value, ‘http://www.oldsite’, ‘http://www.newsite’) WHERE option_name = ‘home’ OR option_name = ‘siteurl';
UPDATE wp_posts SET guid = replace(guid, ‘http://www.oldsite’,’http://www.newsite’);
UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.oldsite’, ‘http://www.newsite’);
UPDATE wp_postmeta SET meta_value = replace(meta_value, ‘http://www.oldsite’, ‘http://www.newsite’);
I used to use this plugin which worked great for transferring sites.
https://wordpress/plugins/velvet-blues-update-urls/
And this plugin is specifically for letting you sync local and remote changes that have been made throuh ftp:
https://wordpress/plugins/ftp-sync/
Or here's a few other popular ones, they pretty much do the same thing:
MPress Fix URL References https://wordpress/plugins/mpress-fix-url-references/
Go Live Update URLS https://wordpress/plugins/go-live-update-urls/screenshots/
本文标签: pathsHow do I 39rebuild39 the WordPress Media library after transfer to new host
版权声明:本文标题:paths - How do I 'rebuild' the WordPress Media library after transfer to new host? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741940921a2406136.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论