[Support request] Hello how to remove adative image auto add of GeneratePress

Home Forums Support [Support request] Hello how to remove adative image auto add of GeneratePress

Home Forums Support Hello how to remove adative image auto add of GeneratePress

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1621579
    Mr Calvert

    I want to used adaptive image of WordPress. So I was go to Setting > Media and setup with size max of image will auto generate with width: 300, 380 and 850 pixel. But when I view source I see it auto have generate different image size is: 768w and 1351w. How to remove auto generate image of Generatepress?

    #1621819
    Leo
    Staff
    Customer Support

    Hi there,

    Are you referring to static images added within content here?

    #1622176
    Mr Calvert

    I referring adaptive image sir! I was go to setting > media and set thumbnail is 300x, medium is 380x, and large is 850x. I think when I upload one image it only auto crop to 4 image with raw, 300x, 380x, and 850x! But why GeneratePress theme was auto crop and generate more I see have 768pixel image and 1351 pixel (equal with width of raw image), so how to remove that? 768x and 1351 is not neccesary.

    #1622439
    David
    Staff
    Customer Support

    Hi there,

    GP doesn’t generate those additional image sizes, that is a core WP function, it always keeps your Full Image, and creates a medium-large image of 768px.

    You can filter the intermediate image sizes using:

    https://developer.wordpress.org/reference/hooks/intermediate_image_sizes/

    Heres an example of that when removing the medium-large:

    add_filter('intermediate_image_sizes', function($sizes) {
        return array_diff($sizes, ['medium_large']);
    });

    For the Full size, you simply need to upload a smaller image size, as theres no simple way to remove the original image that you uploaded.

    #1623127
    Mr Calvert

    I was try add. But it not remove. Can you check for me that? my website URL was attach.
    Size 768px still available when I add your code:

    add_filter('intermediate_image_sizes', function($sizes) {
        return array_diff($sizes, ['medium_large']);
    });
    #1623150
    Mr Calvert

    Hello your code effect. But it need upload new image to effect! how to fix that problem have any way to not upload new image for take effect?
    And can you give me code extra to remove both 3 size this?:
    2x Medium Large 1536px
    2x Large 2048px
    Scaled 2560px

    #1623650
    David
    Staff
    Customer Support

    You will need to install and run the Regenerate Thumbnails plugins to update existing images.

    Those images look like Retina size images, that is not a core function of WP – so you must have a plugin that is generating them.

    #1623927
    Mr Calvert

    Can you give me code to remove more than one size need delete?
    I was try something like this but it not useful

    
    add_filter('intermediate_image_sizes', function($sizes) {
        return array_diff($sizes, ['medium_large']);
        return array_diff($sizes,[‘small’];
    });
    
    #1624303
    Elvin
    Staff
    Customer Support

    Hi,

    You can try my answer here:
    https://generatepress.com/forums/topic/why-wordpress-is-generating-additional-image-copies/#post-1453270

    Also, pay attention to the syntax of your codes. and will cause issues. Make sure you use " or '.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.