Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Instagram Posts Block

No security coverage Under active development 4 sites

This module allows you to display your Instagram feed on your Drupal website. You can retrieve posts from your Instagram account and configure how they appear in a block.

Instagram Posts Block displays the latest posts of an Instagram account in a configurable, responsive block.

Features

  • Responsive grid with a configurable number of posts and columns.
  • Filter by media type: images, videos and reels, or carousel albums.
  • Full, trimmed or hidden captions, and an option to open posts in a new tab.
  • The feed is cached, so pages do not wait for Instagram on every request.
  • The access token is kept out of exported configuration and refreshed automatically during cron.
  • The token's status and expiry date appear on the Status report page.

Requirements

  • Drupal 11.3 or later, or Drupal 12, with PHP 8.3 or later.
  • An Instagram professional account (business or creator).
  • A long-lived access token from a Meta app that uses the Instagram API with Instagram Login, with the instagram_business_basic permission.

Note: Meta shut down the Instagram Basic Display API on 4 December 2024. Tokens created for it no longer work, so you need to generate a new token as described above.

Installation

composer require 'drupal/instagram_posts_block:^3.0@alpha'
drush en instagram_posts_block

Or enable the module under Extend in the admin menu.

Configuration

  1. Go to Configuration » Web services » Instagram Posts Block (/admin/config/services/instagram-posts-block), paste your long-lived access token and save. Click Test connection to check it.
  2. Go to Structure » Block layout, click Place block in a region and choose Instagram Posts Block.
  3. Set the number of posts, posts per row, media type, caption display and link behaviour.
  4. Make sure cron runs at least once a day. Tokens expire after 60 days, and the module refreshes them weekly.

You can also provide the token from settings.php, for example from an environment variable:

$settings['instagram_posts_block_access_token'] = getenv('INSTAGRAM_ACCESS_TOKEN');

Upgrading from 1.x or 2.x

Releases 1.x, 2.0.0 and 2.1.0 do not work on Drupal 11.4 or later. Upgrade to 3.0.x and run drush updb. The update moves your access token out of the block configuration and converts your block settings automatically. Afterwards, re-export your configuration so the token is removed from your config files.

If you have overridden the instagram-posts.html.twig template in your theme, update the override to use the new variables: posts, columns and open_in_new_tab.

Supported versions

  • 3.0.x: active development, for Drupal 11.3 and later and Drupal 12.
  • 1.x and 2.x: unsupported. Please upgrade to 3.0.x.
Drupal 11 · not 10

Ask your assistant about Instagram Posts Block

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
13
Tracked since
May 2023
Latest release
8 hours ago
Releases (12 mo)
7 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
3.0.x-dev Dev 11 PHP 8.3 Nov 29, 2026
3.0.0-alpha1 Pre-release 11 PHP 8.3 Nov 29, 2026
2.0.0-alpha1 Pre-release 11 PHP 8.3 Nov 29, 2026
2.0.x-dev Dev 11 PHP 8.3 Nov 29, 2026
1.1.0 Stable 11 Jan 22, 2026
2.1.0 Stable 11 Jan 22, 2026
2.0.0 Stable Jan 22, 2026
1.0.0-alpha5 Pre-release 9–10 Jun 18, 2023
1.0.0-alpha3 Pre-release 9–10 Jun 18, 2023
1.0.0 Stable 9–10 Jun 18, 2023