Skip to product information
1 of 1
Published:2026.03.16

[Horizon] How to Set Custom OGP Images Per Page Using Metafields in Shopify's Horizon Theme

[Horizon] How to Set Custom OGP Images Per Page Using Metafields in Shopify's Horizon Theme

Applications

  • SNS関連
View full details

In Shopify, "Pages" cannot have individual OGP images set by default, unlike products or blog posts. When any page is shared on social media, it always shows the same OGP image as the homepage.

This TIPS shows how to register an OGP image per page using metafields and output it from the theme. Following the Horizon customization policy, this is implemented without directly editing any vendor files.

Benefits:
- Control the SNS share image for each page individually
- No editing of vendor files (meta-tags.liquid), so no conflicts on theme updates
- All customizations are centralized in custom.globals.liquid

Steps:
1. Add a metafield definition for "Pages" (Admin > Settings > Custom data)
2. Add one line to layout/theme.liquid to load custom.globals
3. Create snippets/custom.globals.liquid with the OGP meta tag output code


How OGP Images Work

What is OGP image - diagram

Step 1: Add a Metafield for Pages

Add metafield definition for Pages

Step 2: Add Custom Liquid to the Header Group

Add Liquid code to custom.globals.liquid

The same TIPS for the Dawn theme is available here. In Horizon, following the customization approach outlined in this blog post, this can be achieved without modifying any original theme files by using custom.globals.liquid.

After making a purchase (all items are ¥0), you will be able to view the sample code.

If you have already made a purchase, please login here.

Sample Codes

Test Theme :Horizon 3.4.0

layout/theme.liquid に1行追加(meta-tags の直後)

snippets/custom.globals.liquid を新規作成