Default AMP CMS Content is Broken

Issue Description

After installing the Magneto 2 AMP extension and making some customizations, you may encounter invalid AMP HTML or broken elements. In this article, you will learn how to find out the cause of this issue and how to fix it.

Solution

We recommend you check whether the customizations caused invalid AMP pages.

Different causes of this problem require different solutions. We recommend that you first determine if invalid AMP pages or broken elements were caused by customizations. Please follow the next three steps.

1. Save your customizations

Copy the content of CMS blocks and pages you edited.

2. Restore Default CMS Content

You can restore all AMP content or some blocks/pages separately. Please follow the appropriate set of commands below.

How to restore all AMP CMS content

Run the following commands in the database
DELETE FROM `cms_page` WHERE `identifier` = 'amp_homepage_1';
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_header_template_1_contact_us';
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_menu_1';
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_footer_template_1_top';
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_footer_template_1_middle_one';
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_footer_template_1_middle_two';
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_footer_template_1_bottom';
DELETE FROM `patch_list` WHERE `patch_name` = 'Plumrocket\\AmpThemeOne\\Setup\\Patch\\Data\\CreateHomepage1';
DELETE FROM `patch_list` WHERE `patch_name` = 'Plumrocket\\AmpThemeOne\\Setup\\Patch\\Data\\CreateHeader1CmsBlock';
DELETE FROM `patch_list` WHERE `patch_name` = 'Plumrocket\\AmpThemeOne\\Setup\\Patch\\Data\\CreateMenu1CmsBlock';
DELETE FROM `patch_list` WHERE `patch_name` = 'Plumrocket\\AmpThemeOne\\Setup\\Patch\\Data\\CreateFooter1CmsBlocks';
Run CLI command
php bin/magento setup:upgrade

How to restore AMP Homepage

Run the following commands in the database
DELETE FROM `cms_page` WHERE `identifier` = 'amp_homepage_1';
DELETE FROM `patch_list` WHERE `patch_name` = 'Plumrocket\\AmpThemeOne\\Setup\\Patch\\Data\\CreateHomepage1';
Run CLI command
php bin/magento setup:upgrade

How to restore AMP Header CMS block

Run the following commands in the database
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_header_template_1_contact_us';
DELETE FROM `patch_list` WHERE `patch_name` = 'Plumrocket\\AmpThemeOne\\Setup\\Patch\\Data\\CreateHeader1CmsBlock';
Run CLI command
php bin/magento setup:upgrade

Restore AMP Menu CMS block

Run the following commands in the database
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_menu_1';
DELETE FROM `patch_list` WHERE `patch_name` = 'Plumrocket\\AmpThemeOne\\Setup\\Patch\\Data\\CreateMenu1CmsBlock';
Run CLI command
php bin/magento setup:upgrade
Run the following commands in the database
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_footer_template_1_top';
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_footer_template_1_middle_one';
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_footer_template_1_middle_two';
DELETE FROM `cms_block` WHERE `identifier` = 'pr_amp_footer_template_1_bottom';
DELETE FROM `patch_list` WHERE `patch_name` = 'Plumrocket\\AmpThemeOne\\Setup\\Patch\\Data\\CreateFooter1CmsBlocks';
Run CLI command
php bin/magento setup:upgrade

3. Revalidate AMP pages

Learn how to validate AMP pages in our documentation.


If your AMP pages are still invalid and the issue remains unresolved, please contact us for further assistance.

Was this article helpful?