0
votes

I have a wordpress self hosted webmagazine site which have 700 posts. Some posts use medium size images and some use custom size images in between posts. How can I force all the published posts to use the full size images (original image size) instead of custom size, medium size images or large size.

After googling I came to a point that there are number of process to make the new posts use default settings but there is no such solution to already published posts.

2

2 Answers

0
votes

I would recommend running a search and replace mysql function, through phpmyadmin or using the following plugin: https://wordpress.org/plugins/search-and-replace/

UPDATE wp_posts SET post_content = replace(post_content, 'oldcontent', 'newcontent');

And just run this to replace/delete every piece of html that wordpress inserts that contributes to it sizing (dimension before the image extension, height and width properties, size property)

0
votes

You can allow the images to be as such on your backend. I mean we do not need to care about the size of saved images on the server. The issue only comes into play while rendering these images on a Mobile App or Desktop Browser.

So the variable sized images should be scaled to best fit its container. The image should retain its original aspect-ratio && make maximum use of its container. This approach however requires that the frame/container size is known before rendering these images.

I have written a image scaling algo here We can improve this algo further(if needed) or we can use a 3rd party API to scale the incoming images from server, before rendering them on the Mobile Device.

Best Regards KP :)