Join Our Newsletter!

Keep up to date with our latest blog posts, new widgets and features, and the Common Ninja Developer Platform.

Providing Sample HTML Code for Manually Embedding Instagram Feeds on Any Website

Sergei Davidov,
Providing Sample HTML Code for Manually Embedding Instagram Feeds on Any Website

While many website builders offer plugins for social media integration, not every platform supports Instagram natively or flexibly. 


If you're aiming for a custom look or working with a code-based site, manually embedding your feed may be the best option. With an Instagram feed widget and some straightforward HTML, you can display your Instagram posts seamlessly on any website. 


This article provides sample HTML code and tips for embedding Instagram feeds manually and effectively.


Why Use an Instagram Feed HTML Widget for Your Website?

Adding an Instagram feed widget for website integration is a smart way to showcase fresh, visually engaging content while keeping your site up to date automatically. Instead of uploading new images manually, the widget pulls your latest Instagram posts and displays them directly on your web pages.


This real-time visual integration boosts user engagement and gives visitors a glimpse into your brand’s personality and daily activity. Whether you're a business, blogger, or creative professional, an Instagram feed HTML widget provides a dynamic visual experience that enhances trust and authenticity.


Because it’s based on HTML, this widget offers flexibility. You can embed it into almost any website platform, from custom-coded sites to WordPress, Wix, or Squarespace. Plus, you can control how it appears using simple CSS for styling.


An Instagram feed HTML widget also reduces your content workload—update Instagram, and your site updates too. It’s an easy, low-maintenance solution to keep your website visually compelling and socially connected.


Enhancing User Engagement with Embedded Instagram Content

Embedding an Instagram feed widget on your website creates an interactive and visually appealing experience that encourages users to stay longer and engage more. When visitors see real-time content pulled directly from your Instagram account, it adds authenticity and personality to your site.


A well-placed feed widget invites users to scroll through photos, discover more about your brand, and even click through to your Instagram profile. This type of social proof builds trust and gives your audience a more personal connection to your content.

It’s especially effective for businesses showcasing products, behind-the-scenes content, or community engagement. The constantly updating visuals keep your website fresh and active without extra effort.


By turning static pages into dynamic, media-rich environments, an Instagram feed widget helps increase time on site, reduce bounce rates, and foster deeper engagement with your brand—all through content you’re already sharing on social media.


Benefits of Manual Embedding Over Third-Party Tools

Using a manually coded feed widget offers greater control, faster performance, and increased compatibility across platforms compared to third-party tools. With manual embedding, you can fine-tune how your Instagram feed looks and behaves, customizing layout, size, and styling through clean HTML and CSS.


Unlike third-party widgets that often rely on external scripts, a manual feed widget reduces the risk of slow load times or conflicts with other plugins. You’re not limited by the design restrictions or branding of external apps, which means your feed can blend seamlessly with your site’s aesthetic.


Manual embedding also means you don’t depend on recurring subscriptions or risk losing access if a service shuts down. It’s a one-time setup that puts full control in your hands.

For those who prefer a leaner, more tailored solution, using a custom feed widget is a smart, efficient alternative to plugin-based options.


Sample HTML Code for an Instagram Feed Widget

Embedding a simple, lightweight Instagram feed HTML widget on your website gives you full control over how your content is displayed. While Instagram no longer provides direct embed access to entire feeds, you can still use custom HTML solutions powered by third-party display services or manually add selected posts using embed codes. 


Below is a basic example of a feed widget setup using iframe-based embedding.


<div class="Instagram-feed-widget" style="max-width: 100%; text-align: center;">

  <h2>Follow Us on Instagram</h2>

  <iframe 

    src="https://www.Instagram.com/YOUR_USERNAME/embed" 

    width="320" 

    height="400" 

    frameborder="0" 

    scrolling="no" 

    allowtransparency="true" 

    style="border: none; overflow: hidden;">

  </iframe>

</div>


This example pulls a single post or profile preview into your site. To create a dynamic feed widget that updates automatically, you’ll likely need to use tools like LightWidget, SnapWidget, or a custom API-based setup. These generate embeddable HTML snippets that show multiple posts in a grid or slideshow format.


Once you have the HTML code, simply paste it into your site’s footer, sidebar, or a custom HTML block. You can customize the container with CSS to match your website’s branding.

An Instagram  feed widget like this keeps your website visually current, increases engagement, and provides seamless integration with your social media. For advanced users, using the Instagram Basic Display API lets you build fully custom feeds with greater flexibility.


Basic HTML Snippet and Structure

Creating a simple Instagram feed HTML widget starts with a clean, responsive HTML container and a reliable embed method. Below is a basic snippet to get started:


<div class="Instagram-feed-widget" style="text-align:center; max-width:100%;">

  <h3>Follow Us on Instagram</h3>

  <iframe 

    src="https://snapwidget.com/embed/123456" 

    width="100%" 

    height="400" 

    frameborder="0" 

    scrolling="no" 

    allowtransparency="true" 

    style="border:none; overflow:hidden;">

  </iframe>

</div>


This code uses a third-party service like SnapWidget to display a feed. You can easily replace the embed link with one from a different provider or custom solution.


The structure ensures your feed widget is centered and responsive. Add custom CSS for font styles, padding, or spacing to better match your site's design.


This lightweight setup allows the feed widget to load quickly and adapt across devices, offering seamless social media integration.


Customizing Width, Height, and Layout for Your Site

To make your feed widget fit perfectly within your website’s design, you’ll need to adjust its width, height, and layout using HTML and CSS. Start by setting a responsive width—using width: 100% allows the widget to scale with your site’s container, making it mobile-friendly.


For height, choose a fixed value like 400px or allow dynamic height if your embed provider supports it. Adjust this based on how many posts you want visible at once. A taller feed widget works well for grid displays, while a shorter one suits sliders or single-post previews.


Use CSS to control layout elements such as padding, alignment, and margins. For example:


.Instagram-feed-widget {

  max-width: 800px;

  margin: auto;

  padding: 20px;

}


Fine-tuning these dimensions ensures your Instagram feed HTML widget blends seamlessly with your site’s style while maintaining optimal performance and user experience.


How to Embed and Optimize Your Instagram Feed HTML Widget

Adding an Instagram feed HTML widget to your website is a simple yet powerful way to display social content while keeping your site visually fresh. To embed it, first generate the HTML snippet from a tool like SnapWidget, LightWidget, or your own custom code using the Instagram Basic Display API. Copy the snippet and paste it into your website’s HTML—either within a widget area, a custom code block, or your site’s footer or sidebar.


Once embedded, it’s important to optimize your feed widget for performance and appearance. Set the width to 100% for responsive design and define an appropriate height to maintain balance on the page. Compress any linked scripts and styles, and avoid loading too many posts at once to prevent slow load times.


To ensure a seamless user experience, always preview your feed widget on mobile and desktop. Customizing it with CSS can help it blend with your site’s branding.

For the best impact, place the feed widget on high-traffic pages like your homepage or blog sidebar. Regular updates from your feed will keep visitors engaged and highlight your active social presence in real time.


Ensuring Mobile Responsiveness and Performance

To keep your Instagram  feed widget mobile-friendly, use responsive design techniques like setting the width to 100% and avoiding fixed pixel values for layout elements. This ensures the widget adjusts smoothly to various screen sizes without breaking the layout.


Limit the number of displayed posts to improve load time, especially for mobile users. If your widget provider supports lazy loading, enable it to load images only when they’re visible on screen.


Test your feed widget on multiple devices and browsers to confirm it loads quickly and displays cleanly across platforms for all users.


Troubleshooting Common Issues with Manual Embeds

When adding an Instagram feed widget manually, you may encounter issues like broken embeds, slow loading, or display errors. First, ensure the embed code is correctly copied and pasted without missing tags or extra characters.


If the feed isn’t showing, confirm that the embed link is active and hasn’t expired—some services generate time-limited URLs. Also, check your site’s security settings, as mixed content (HTTP vs. HTTPS) can block external content.


For layout problems, inspect your CSS for conflicts or overrides. A well-structured, clean embed setup ensures your feed widget runs smoothly across devices.


Customize Your Website with a Manual Instagram Feed Widget

Using HTML to add an Instagram feed widget gives you more control over how your content appears across different platforms.


By following the sample code and adjusting it to your needs, you can maintain a visually consistent, up-to-date feed that enhances your site’s appeal. Try it out today and make your Instagram presence shine right on your website!