• Resolved dav74

    (@dav74)


    Is there any way we can automatically autodelete the copies of images your plugin creates on our server? If we post several instagram images each day, we start to quickly have a very large number of images build up. Many thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Smash Balloon Louis

    (@smashballoonlouis)

    Hi @dav74,

    Thank you for contacting us! We don’t have a way to automatically delete these, but you can limit the number that are created by adding the following code snippet to the functions.php file of your active theme:

    function sb_custom_max_cache( $max_cache ) {
        return 20;
    }
    add_filter( 'sbi_max_cache_size', 'sb_custom_max_cache', 10, 1 );

    The normal cache is set to 500 to make sure there is adequate permanently cached posts. The above will store 20 posts per feed, which is 60 files max (3 sizes).

    I hope this helps! Please let us know if you have any other questions or concerns.

    Best regards,
    Louis

    Thread Starter dav74

    (@dav74)

    Many thanks for this. Just to confirm, will this then automatically delete the oldest photos from our server when there are more than 20 image posts?

    Plugin Support Smash Balloon Louis

    (@smashballoonlouis)

    Hi @dav74,

    It’s my pleasure to help! After setting this up, you’ll need to Reset the Optimized Images at WordPress Dashboard > Instagram Feed > Settings > Advanced once more, but then it should work automatically going forward.

    I hope this helps! Please let us know if you have any other questions.

    Best regards,
    Louis

    Thread Starter dav74

    (@dav74)

    Perfect! Last question. I actually added this snippet via the “code snippets” plugin. In that plugin we can chose to load the script only in the site admin area (rather than also on the front-end). Do you think we need to run this script also on the front-end of the site, or can we load it just in the WP admin area?

    Thanks

    Plugin Support Smash Balloon Louis

    (@smashballoonlouis)

    Hi?@dav74,

    Sorry for the delay. We suggest adding this PHP code snippet in the functions.php file of the site’s active theme. When adding the code this way, it will run in all areas, so if you are testing adding the PHP code with another method, I would suggest adding it all areas there as well.

    I hope this helps!

    Best regards,
    Louis

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Auto delete local image copies’ is closed to new replies.