How do I fix broken links to images in imported posts' post_content?

I recently imported custom posts and their attached images from one WP site to another. Each image exists in the media l

I recently imported custom posts and their attached images from one WP site to another. Each image exists in the media library, but inside each post's content, the link to the image is /wp-content/uploads/[name_of_image]-[width]x[height].jpg i.e. /wp-content/uploads/tree.jpg is being referred to as /wp-content/uploads/tree-700x394.jpg but that particular size for the image does not exist.

If I click on the broken image inside the post editor, the thumbnail for the image populates inside the editor and I can choose one of the sizes for the image that exists. If I update the image and the post, it fixes the issue, but I don't want to do that for each post and I think it would be really useful to understand how to fix something like this more efficiently.

I am wondering if there is a plugin which can either generate each size of the images found in posts, i.e. make `tree-700x394' or that can go through and just change all of the images to their original size.

Edit: I saw Why won't these imported images show up? with the same problem and tried regenerating thumbnails but it did not work.

I recently imported custom posts and their attached images from one WP site to another. Each image exists in the media library, but inside each post's content, the link to the image is /wp-content/uploads/[name_of_image]-[width]x[height].jpg i.e. /wp-content/uploads/tree.jpg is being referred to as /wp-content/uploads/tree-700x394.jpg but that particular size for the image does not exist.

If I click on the broken image inside the post editor, the thumbnail for the image populates inside the editor and I can choose one of the sizes for the image that exists. If I update the image and the post, it fixes the issue, but I don't want to do that for each post and I think it would be really useful to understand how to fix something like this more efficiently.

I am wondering if there is a plugin which can either generate each size of the images found in posts, i.e. make `tree-700x394' or that can go through and just change all of the images to their original size.

Edit: I saw Why won't these imported images show up? with the same problem and tried regenerating thumbnails but it did not work.

Share Improve this question edited Jan 30, 2020 at 6:28 Sards asked Jan 30, 2020 at 4:14 SardsSards 12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I added a new thumbnail to the site by inserting add_image_size('project', 700, 9999 ); into functions.php because it seemed like all of the images from old posts were set to 700 width and an automatic height. Then I installed and ran Regenerate Thumbnails and it fixed the issue.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744790733a4593897.html

相关推荐

  • How do I fix broken links to images in imported posts' post_content?

    I recently imported custom posts and their attached images from one WP site to another. Each image exists in the media l

    9小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信