Docs    Instagram    Documentation

How Does Image Resizing and Optimization Work?

Instagram serves 1080 pixel images, so the plugin stores resized copies to keep your pages loading quickly. How that works.

Would you like to know where Instagram Feed saves your feed’s images and how to control those copies?

Instagram Feed and Instagram Feed Pro both save smaller copies of your post images on your own site. This guide explains when the copies are made, where they live, how many are kept, and how to turn image resizing off.

Before you get started, make sure Instagram Feed is installed and activated on your site.

Here is what we will cover.

When Are Images Created?

The image files that come from Instagram are large, about 1080 pixels wide. To keep your site loading quickly, the plugin makes smaller copies on your own server.

The first time a new post appears in your feed, the page sends the plugin a request in the background (an AJAX call). The request lists the posts that don’t have copies yet. The plugin then creates the images on your server. Until a post’s images are ready, the feed shows the image from Instagram. After that, every page load uses the local files, at the size that fits the feed.

If your feed checks for new posts in the background, the plugin also creates images for the new posts during that update. To learn more about the update schedule, see our guide on why a feed updates slowly or not at all.

Image Sizes and Format

For each post, the plugin creates three sizes.

  • 640 pixels wide, used for the Full size (640×640) resolution.
  • 320 pixels wide, used for the Medium (320×320) resolution.
  • 150 pixels wide, used for the Thumbnail (150×150) resolution.

By default, the Resolution setting in the feed customizer is Auto-detect (recommended), which picks the size that fits your feed. If your images look soft or pixelated, see our guide on distorted, blurry, or cut off images.

The plugin saves the copies as WebP files by default. WebP files are usually smaller than JPG files, so they load faster. If your server’s image editor can’t make WebP files, the plugin saves JPG files instead. You can also choose JPG yourself with the Default Image Format setting in Instagram Feed » Settings » Advanced. That setting shows only while Use dynamic sizes is turned on.

The plugin makes the copies with the WordPress image editor, which uses either GD or Imagick, whichever your server has. Imagick isn’t required.

Where Are Images Stored?

The local image files are stored in the uploads folder of your WordPress files, in a folder named sb-instagram-feed-images. The plugin also saves the profile pictures it shows in your feed header as local files in that folder.

The plugin also creates two custom tables in your WordPress database, named sbi_instagram_feeds_posts and sbi_instagram_posts. Your database prefix comes first in each name, for example wp_sbi_instagram_posts. The tables track which posts have images and which feeds show them.

Are There Any Limits to How Many Images Are Stored?

Yes. The plugin keeps a limited number of post records, and each record has its own images. The limit keeps the stored images from overloading your server.

  • The free version of Instagram Feed keeps up to 350 records.
  • Instagram Feed Pro keeps up to 1500 records.

Once the limit is reached, the plugin deletes the records that were shown least recently, along with their image files, before it creates new images.

To change the limit, define the SBI_MAX_RECORDS constant in your wp-config.php file. For example, this line sets the limit to 1000 records.

define( 'SBI_MAX_RECORDS', 1000 );

The plugin also limits how fast it creates new images. If more than 100 new post records were added in the last 15 minutes, the plugin stops creating images until that window passes. Spreading the work out this way keeps your server from being overloaded.

When Will the Plugin Use Images From Instagram’s CDN?

Here are the circumstances where your feed shows images from Instagram’s CDN.

  • The post hasn’t been displayed in the feed before. This changes once the plugin creates the local images.
  • The local image file didn’t load. The plugin then switches to the image from Instagram.
  • The plugin couldn’t create the local image for that post. It doesn’t try that post again.
  • Use dynamic sizes is turned off.
  • The plugin is waiting out its limit on new images, described in Are There Any Limits to How Many Images Are Stored? above.

If your feed still shows images from Instagram’s CDN and none of these apply, an error may have happened while the plugin created the images. The most common cause is that the WordPress image editor isn’t available on your server. To learn how to fix it, see our guide on images that are missing or showing errors. If the images stay wrong after your server is fixed, see our guide on resetting image storage.

Can the Plugin Only Use Local Images?

The plugin always prefers the local copy of an image once it exists, and no setting changes that. To stop your visitors’ browsers from loading anything from Instagram’s servers, set the GDPR setting to Yes. The setting is in Instagram Feed » Settings » Feeds. With it set to Yes, the feed shows only local images, and shows blank placeholder images until the local ones are ready.

Some features are limited when GDPR is set to Yes, and the setting depends on image resizing working on your server. To learn more, see our guide on Instagram Feed and GDPR compliance.

Can I Disable Image Resizing?

Yes. Use dynamic sizes is on by default, so your feed shows the smallest local copy that fits where each image is displayed. The copies use storage on your site. Turning the setting off stops the plugin from creating new copies, and your feed then shows the images from Instagram.

Note: If the GDPR setting is Yes, keep Use dynamic sizes turned on. With Yes, your feed shows only local images, so it needs the copies this setting creates.

  1. In the WordPress dashboard, go to Instagram Feed » Settings.
  2. From the tabs at the top of the page, click Advanced.
  3. In the Image Optimization (Recommended) section, turn off Use dynamic sizes.
  4. At the top right of the page, click Save Changes.

The copies that are already stored stay on your site until you delete them. To remove them and the plugin’s saved post records, click Reset Image Storage next to the Image Optimization (Recommended) heading. For what the reset clears, see our guide on resetting image storage.

To see what Use dynamic sizes and Reset Image Storage do, see Image Optimization in our Instagram Feed Settings Reference.

What Other Features Use the Image Resizing System?

  • Local copies of profile pictures are created and stored for use in the feed header.
  • The GDPR setting relies on the local images, as described in Can the Plugin Only Use Local Images? above.
  • In Instagram Feed Pro, recent hashtag feeds (Plus license level or higher) rely on the plugin’s saved post records to show older posts. Instagram no longer returns those posts after 24 hours. The plugin saves those records only while Use dynamic sizes is turned on, and Reset Image Storage deletes them.

That’s it! You now know how Instagram Feed creates, stores, and limits its local images. If your feed also shows old posts or updates late, see our guide on why a feed updates slowly or not at all.

Frequently Asked Questions

Below, we’ve answered some of the most common questions about image resizing.

Does image resizing need Imagick?

No. The plugin uses the WordPress image editor, which works with either GD or Imagick. If your server has neither, the plugin can’t create local images. See our guide on images that are missing or showing errors.

Does the free version store fewer images than Instagram Feed Pro?

Yes. The free version keeps up to 350 post records and Instagram Feed Pro keeps up to 1500. Both use the same three sizes and the same settings in Instagram Feed » Settings » Advanced.

Which image format does the plugin use?

WebP by default, or JPG if your server can’t make WebP files or if you choose JPG in the Default Image Format setting. For details, see Image Sizes and Format.

support

Couldn’t find your answer in the docs?

Contact Support