Instagram shortcode
Embed an Instagram post in your content using the instagram shortcode.
Usage
The instagram shortcode embeds the Instagram post with the given ID. The ID is the last segment of the post’s URL. For example, the ID of the post at https://www.instagram.com/p/CxOWiQNP2MO/ is CxOWiQNP2MO.
Adjust the privacy settings for this shortcode in your project configuration. These are the default settings:
privacy:
instagram:
disable: false
simple: false
[privacy]
[privacy.instagram]
disable = false
simple = false
{
"privacy": {
"instagram": {
"disable": false,
"simple": false
}
}
}
disable- (
bool) Whether to disable the shortcode. Default isfalse. simple- (
bool) Whether to enable simple mode for image card generation. Iftrue, Hugo creates a static card without JavaScript. This mode supports only image cards, and the browser loads the image directly from Instagram’s servers. Default isfalse.
To override Hugo’s embedded instagram shortcode, copy the source code to a file with the same name in the layouts/_shortcodes directory.
Arguments
The instagram shortcode accepts a single positional argument.
ID- (
string) The ID of the Instagram post.
Examples
content/example.md
{{< instagram CxOWiQNP2MO >}}Your browser displays this:
Last updated:
November 16, 2026
:
content: Apply style guide to shortcodes section (bd893690d)
Improve this page