Troubleshooting Common AMP Plugin Issues: Language, CSS, and Compatibility
Content
Common AMP Plugin Challenges and How to Resolve Them
The official AMP for WordPress plugin is a powerful tool for creating fast, mobile-friendly pages. However, users sometimes encounter issues related to language, theme compatibility, and CSS limitations. Based on common community support threads, this guide outlines the most frequent problems and their solutions.
1. Language and RTL (e.g., Persian) Display Issues
The Problem: Users report that plugin configuration wizards, counters, or other elements appear broken or "messy" when their site language is set to Persian or other Right-to-Left (RTL) languages. The issue often resolves when switching to English.
Why It Happens: This is typically caused by a CSS overbudget error. The AMP framework enforces a strict limit of 75KB of CSS per page. When a site uses an RTL language, it often loads additional CSS files to handle the RTL styling. If the combined CSS from the theme and plugins exceeds this limit, the AMP plugin's sanitizer will remove the excess, breaking the layout.
The Solution:
- Identify the source of the excess CSS. Navigate to AMP > CSS in your WordPress admin dashboard. This validation tool will show you which plugins or themes are contributing the most CSS.
- Work to reduce CSS bloat. This may involve:
- Contacting your theme author and asking them to optimize their AMP-compatible CSS.
- Deactivating non-essential plugins that add large amounts of CSS.
- Using a more lightweight, AMP-optimized theme.
2. JSON File Errors During Setup Wizard
The Problem: Users get stuck in the configuration wizard with an error referencing a problem with a JSON file.
Why It Happens: This error is frequently related to a caching plugin or server-level caching that is corrupting the JSON response needed for the wizard to communicate properly. It has also been a known bug in specific plugin versions (e.g., 2.2.2) that was later patched.
The Solution:
- Update the AMP Plugin: Ensure you are running the latest version of the AMP plugin to benefit from bug fixes.
- Disable Caching Temporarily: Clear all your caches and temporarily disable any caching plugins (e.g., WP Rocket) or server-side caching. Try running the setup wizard again.
- Check PHP Version: While the plugin works with PHP 5.6, it is always recommended to use a newer, supported PHP version (7.4 or higher) for better performance and security.
3. Theme and Plugin Compatibility Problems
The Problem: Features like social sharing buttons, scroll-to-top functions, galleries, or review plugins stop working after enabling AMP. A common example is themes like Jannah or Newspaper that have their own custom AMP implementations.
Why It Happens: AMP pages do not allow most custom JavaScript, which is what many plugins and complex themes rely on for their functionality. If a theme (like Jannah) is not fully AMP-compatible, the plugin will default to using its simpler "Reader" mode template, which may not support all features.
The Solution:
- Check for AMP Compatibility: Before using a plugin or theme, verify it is advertised as AMP-compatible.
- Use AMP-Compatible Alternatives: For features like chat, use components like
amp-facebook-pageor services liketawk.to. For cookie banners, consider the Complianz plugin, which has some AMP support. - Exclude Incompatible Pages: You can exclude specific pages or post types from AMP. Go to AMP > Settings > Supported Templates to configure this. You can also exclude individual pages from the post editor settings.
- Contact the Theme/Plugin Author: The best long-term solution is to contact the author of the incompatible product (e.g., Jannah support) and request they make their product fully compatible with the official AMP plugin.
4. The fetchpriority="high" Validation Error
The Problem: A validation error appears for the fetchpriority="high" attribute on images.
Why It Happens: This is a known issue where the AMP specification had not yet approved this attribute. The AMP plugin's validator flags it as an error.
The Solution: This is generally a harmless warning that can be ignored. If the error messages are bothersome, you can suppress them using a filter in your theme's functions.php file:
add_filter( 'amp_validation_error_sanitized', function( $sanitized, $error ) { if ( false !== strpos( $error['message'], 'fetchpriority' ) ) { return true; } return $sanitized; }, 10, 2 );
Always back up your site before editing theme files.
Conclusion
Many common AMP plugin issues stem from three core areas: CSS limits, JavaScript incompatibility, and conflicts with specific themes. The first steps toward a solution are almost always to update all software, use compatible products, and utilize the plugin's built-in validation tools to identify the root cause. For further assistance, the WordPress support forums are an excellent community resource.
Related Support Threads Support
-
Table scrolling not workhttps://wordpress.org/support/topic/table-scrolling-not-work/
-
Error in social sharinghttps://wordpress.org/support/topic/error-in-social-sharing/
-
Problem with excluded linkshttps://wordpress.org/support/topic/problem-with-excluded-links/
-
cookie banner does not appear on the websitehttps://wordpress.org/support/topic/cookie-banner-does-not-appear-on-the-website/
-
Chat pluginhttps://wordpress.org/support/topic/chat-plugin-14/
-
Scroll To Top Issue [Kadence]https://wordpress.org/support/topic/scroll-to-top-issue-kadence/
-
Next Story div renders multiple times when using amp-next-pagehttps://wordpress.org/support/topic/next-story-div-renders-multiple-times-when-using-amp-next-page/
-
Translate to Arabic & delayhttps://wordpress.org/support/topic/translate-to-arabic-delay/
-
Problem configuring plugin wizard in json filehttps://wordpress.org/support/topic/problem-configuring-plugin-wizard-in-json-file/
-
Display as carousel error after updatehttps://wordpress.org/support/topic/display-as-carousel-error-after-update/
-
Appearance problem in the plugin counterhttps://wordpress.org/support/topic/appearance-problem-in-the-plugin-counter/
-
CusRev Compatibility Issuehttps://wordpress.org/support/topic/cusrev-compatibility-issue/
-
Table Fully not viewedhttps://wordpress.org/support/topic/table-fully-not-viewed/
-
infinite scroll or amp-next-pagehttps://wordpress.org/support/topic/infinite-scroll-or-amp-next-page/
-
Homepage Broken with Plugin Activatedhttps://wordpress.org/support/topic/homepage-broken-with-plugin-activated/
-
[NSFW] fetchpriority=”high” errorhttps://wordpress.org/support/topic/fetchpriorityhigh-error/
-
i get this messagehttps://wordpress.org/support/topic/i-get-this-message/
-
Plugin deleted all tags picturehttps://wordpress.org/support/topic/plugin-deleted-all-tags-picture/
-
legacy theme not downloading directlyhttps://wordpress.org/support/topic/legacy-theme-not-downloading-directly/
-
Add latest posts / Read more postshttps://wordpress.org/support/topic/add-latest-posts-read-more-posts/
-
How to enable infinite scroll or amp-next-page for single posthttps://wordpress.org/support/topic/how-to-enable-infinite-scroll-or-amp-next-page-for-single-post/
-
Tags store pageshttps://wordpress.org/support/topic/tags-store-pages/
-
Meu tema não aceita modo transição só modo leitorhttps://wordpress.org/support/topic/meu-tema-nao-aceita-modo-transicao-so-modo-leitor/
-
problem amphttps://wordpress.org/support/topic/problem-amp/
-
javascript not displayed in browser errorhttps://wordpress.org/support/topic/javascript-not-displayed-in-browser-error/
-
Erorhttps://wordpress.org/support/topic/eror-15/
-
Erro plugin bdthemes-prime-slider-litehttps://wordpress.org/support/topic/erro-plugin-bdthemes-prime-slider-lite/
-
Critical Error – Gezi Rehberihttps://wordpress.org/support/topic/critical-error-gezi-rehberi/
-
How I can use plugin Theia poster with AMPhttps://wordpress.org/support/topic/how-i-can-use-plugin-theia-poster-with-amp/