Support » Plugin: AMP for WordPress » AMP Pages Not Working After Update

  • All my amp pages not working after updating plugin. I mean content not showing on all amp pages..

    See original links

    Amp pages not showing any content, only Title of the article..

    Also i am getting AMP errors on Google Search Console on all articles.

    See errors messages:

    1. AMP content does not match its canonical page – mostly all articles throwing same error..

    2. CSS syntax error in tag ‘style amp-custom’ – invalid declaration. – Getting this error only on

    Let me know how to fix

    • This topic was modified 5 months, 2 weeks ago by  tecmint.
    • This topic was modified 5 months, 2 weeks ago by  tecmint.

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • @westonruter could you please check and give me a fix for my AMP pages..

    • This reply was modified 5 months, 2 weeks ago by  tecmint.
    Plugin Author Weston Ruter

    (@westonruter)

    @tecmint The reason for the CSS error on https://www.tecmint.com/it-security-and-ethical-hacking-certification-courses/amp/ is because the HTML contains:

    <strong style="&quot;color: red;">98%</strong>

    Remove the &quot; and that will be fixed.

    As for why the why the content is empty, that is a strange one. What plugins do you have active?

    @westonruter The CSS issue I fixed, but about content is still not showing…

    I use following plugins..

    Akismet Anti-Spam
    All In One SEO Pack
    AMP
    Facebook Like Thumbnail
    Google XML Sitemap for Images
    Google XML Sitemaps
    Lazy Load
    Light – Responsive LightBox
    QuickieBar PRO
    Really Simple SSL
    Subscribe to Comments Reloaded
    WP Fastest Cache
    WP-PageNavi

    I am using these plugins since last 4 years and AMP plugin was added 2 years back it was running smooth till May 5th, after plugin update suddenly the content stopped showing…

    I am using PHP 5.3.3 ..

    • This reply was modified 5 months, 2 weeks ago by  tecmint.
    Plugin Author Weston Ruter

    (@westonruter)

    It’s strange. It’s as if a plugin is doing add_filter( 'the_content', '__return_empty_string' ) which obviously doesn’t make sense.

    @tecmint Can can you search the source of the plugins to find mentions of “the_content” in both the plugins above and your active theme? That could help narrow where the problem is. It certainly looks like a problem with that filter.

    @westonruter,

    I used to grep utility to find the ‘the_content’ string in the plugins directory and this is what I get..

    plugins/all-in-one-seo-pack/modules/aioseop_sitemap.php:			// Check images galleries in the content. DO NOT run the_content filter here as it might cause issues with other shortcodes.
    plugins/all-in-one-seo-pack/trunk/modules/aioseop_sitemap.php:			// Check images galleries in the content. DO NOT run the_content filter here as it might cause issues with other shortcodes.
    plugins/amp/includes/templates/class-amp-content.php:		// First, embeds + the_content filter.
    plugins/amp/includes/templates/class-amp-content.php:		$content        = apply_filters( 'the_content', $content );
    plugins/amp/includes/utils/class-amp-validation-utils.php:		$wrapped_filters = array( 'the_content', 'the_excerpt' );
    plugins/amp/includes/utils/class-amp-validation-utils.php:		$markup = apply_filters( 'the_content', $markup );
    plugins/amp/jetpack-helper.php: * Remove the Related Posts placeholder and headline that gets hooked into the_content
    plugins/amp/jetpack-helper.php:		remove_filter( 'the_content', array( $jprp, 'filter_add_target_to_dom' ), 40 );
    plugins/amp/readme.txt:- Fix: Don't fire the_content for featured image output
    plugins/amp/wpcom-helper.php:add_action( 'pre_amp_render_post', 'jetpack_amp_disable_the_content_filters' );
    plugins/amp/wpcom-helper.php: * Disable the_content filters for Jetpack.
    plugins/amp/wpcom-helper.php:function jetpack_amp_disable_the_content_filters() {
    plugins/wp-fastest-cache/inc/cache.php:			remove_filter('the_content_feed', 'wp_staticize_emoji');
    plugins/lazy-load/lazy-load.php:		add_filter( 'the_content', array( __CLASS__, 'add_image_placeholders' ), 99 ); // run this later, so other content filters have run, including image_add_wh on WP.com
    plugins/subscribe-to-comments-reloaded/wp_subscribe_reloaded.php:			remove_filter( 'the_content', 'wpautop' );
    
    • This reply was modified 5 months, 2 weeks ago by  tecmint.
    Plugin Support Ryan Kienstra

    (@ryankienstra)

    Thank You, Follow-up Questions

    Hi @tecmint,
    Thanks for listing all of your plugins. I couldn’t reproduce the issue, but could you please help with some questions?

    1. In the editors for the posts that you linked to above, do you see any warnings like this?

    Warning classic editor

    2. Have you added any custom filters or code for the AMP plugin, by chance?

    Steps Taken:
    1. Installed and activated the following plugins, using wp plugin install <slug> and wp plugin activate <slug>

    akismet
    all-in-one-seo-pack
    facebook-like-thumbnail
    amp
    facebook-like-thumbnail
    google-image-sitemap
    google-sitemap-generator
    rocket-lazy-load Lazy Load by WP Rocket (couldn’t find the plugin “Lazy Load”)
    responsive-lightbox-lite Responsive Lightbox (couldn’t find the plugin “Light – Responsive LightBox”)
    quickiebar
    really-simple-ssl
    subscribe-to-comments-reloaded
    wp-fastest-cache
    wp-pagenavi

    2. Activated the twentyfifteen theme.
    3. Created a new post, and added the content from this post:
    https://www.tecmint.com/how-to-check-disk-space-in-linux/
    using the content > rendered value from the post’s REST API response:

    https://www.tecmint.com/wp-json/wp/v2/posts/1987

    Result: the AMP URL of the post displays as expected:
    Post content local environment

    The only plugins that had add_filter( ‘the_content’ … ) are rocket-lazy-load and responsive-lightbox-lite. And I couldn’t find a scenario where they would return an empty string, or not return anything.

    @ryankienstra

    No I didn’t see any warnings while adding content in WP post editor.

    No, I didn’t added any custom code to amp plugin nor to any of the plugins I am using now.

    I am using Hueman Theme for your information.

    I found the fix, actually with AMP 0.6.2 version, the content is displaying correctly, I have tested on my local setup.

    But when I am using AMP 0.7.0 version the content is not showing..

    I have more than 3000 pages, and all of them showing errors on Google Search Console, so the way to fix for now is to use AMP 0.6.2, until you guys fix the issue in new version AMP 0.7.0.

    • This reply was modified 5 months, 2 weeks ago by  tecmint.
    • This reply was modified 5 months, 2 weeks ago by  tecmint.

    @ryankienstra and @westonruter

    Any update about fix? or should I use different AMP plugin?

    Plugin Support Ryan Kienstra

    (@ryankienstra)

    Sorry, No Solution In Mind

    Hi @tecmint,
    Thanks for your help in debugging this.

    Sorry, I don’t have a solution in mind, having debugged this locally. If we come across this again, we’ll ping you on this topic.

    If you’re willing to try this, could you deactivate all of the plugins on your local setup, other than AMP? It’d also be interesting to see if if this exists with another theme.

    • This reply was modified 5 months, 2 weeks ago by  Ryan Kienstra.

    @ryankienstra,

    I tried that too, disabled all plugins except AMP, still the content is not showing with AMP version 0.7.0..

    The older version of AMP 0.6.2, works perfectly, that means issue with new AMP version only…that you have to fix…

    Plugin Author Weston Ruter

    (@westonruter)

    @tecmint Do you have a staging or dev environment where you could give us access to debug?

    @westonruter

    Sorry I don’t have live dev environment setup, for now I switched to older version of AMP 0.6.2, links are working now…

    https://www.tecmint.com/install-piwigo-photo-gallery-in-centos/amp/

    I hope you guys fix it soon…I don’t want to use other AMP, I liked your plugin.

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.