You can to insert custom "amphtml" link tag in your blog post page by enabling either search description or enclosure links setting from Blogger dashboard.
Custom search description data is globally available hence you can use it anywhere in your blog template. Enclosure links, on the other hand, only available in Blog widget, technically within a section somewhere in <body> tag, but with adtanvtages: it's possible to add multiple enclosure links to your post.
You may choose one over another or use both to provide extra custom data depending on your need.
This method allows you to insert custom data in <head> part of your blog template for each posts. Under Settings > Meta tags, toggle on Enable search description. Note that it's different from post snippets which is a shorter or summary version of your post.
![]() |
| Enabling search description setting |
Now you should be able to provide custom search description in Post settings.
![]() |
| Inserting post search description in Post settings |
You can then use <data:view.description/> to access post search description data which is globally available. In this case, we want to store the value as a link href attribute value, so we use expr prefix.
| html |
|---|
<head> ... <link expr:href='data:view.description' rel='amphtml'/> ... </head> |
Under Settings > Site feed, toggle on Title and enclosure links.
![]() |
| Enabling Title and enclosure links setting |
Now you should be able to add enclosure links in Post settings. Insert your amp page URL and set mime type to anything, for example: "amphtml". You can use mime type information to determine how you would display the data later.
![]() |
| Inserting post's enclosure links in Post Settings |
Unlike search description, enclosure links data only available within Blog widget, so you can't insert it in <head> part of your template. To access enclosure links data, first loop through data:posts, then access enclosures data of each posts.
| html |
|---|
<body>
...
<b:section id='main'>
<b:widget id='Blog1' locked='false' title='Blog Posts' type='Blog' version='2' visible='true'>
...
<b:includable id='main'>
<b:loop values='data:posts' var='post'>
<b:loop values='data:post.enclosures' var='enclosure'>
<link expr:href='data:enclosure.url' expr:rel='data:enclosure.mimeType'/>
</b:loop>
</b:loop>
</b:includable>
...
</b:widget>
</b:section>
...
</body> |