Title: AMP validation error
Last modified: August 31, 2016

---

# AMP validation error

 *  Resolved [Cowboy Coding](https://wordpress.org/support/users/devaceza-1/)
 * (@devaceza-1)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/amp-validation-error/)
 * Hi,
 * Good Day…
 * I found out that your awesome plugin causing validation error on AMP pages “The
   attribute ‘href’ in tag ‘link rel=stylesheet for fonts’ is set to the invalid
   value ‘autoptimize/css/autoptimize_c0295bf7c0c50ee378d0bf045f8d6cef.css’.”.
 * Can you help me on how to fix the issue please ?
 * Thanks
 * Regards
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/amp-validation-error/#post-7353641)
 * _very_ weird devaceza; AO is not supposed to be active an AMP-pages. can you 
   share your URL here or via futtta-at-gmail-dot-com?
 * frank
 *  Thread Starter [Cowboy Coding](https://wordpress.org/support/users/devaceza-1/)
 * (@devaceza-1)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/amp-validation-error/#post-7353644)
 * Hi Frank
 * I sent to your email the URL, can you confirm please that you received it?
 * Thanks
 * Regards,
    Aaron
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/amp-validation-error/#post-7353649)
 * OK, the problem is that AO currently bails when it encounters
    `<html amp` or`
   <html ⚡`
 * while you have
    `<html dir="ltr" amp>`
 * Which is correct for amp but AO just doesn’t recognize it as an AMP-page.
 * Give me a second, I’ll be back with a workaround soon (and will fix for the next
   AO-version).
 * Oh, question; which plugin are you using to have AMP-pages?
 * frank
 *  Thread Starter [Cowboy Coding](https://wordpress.org/support/users/devaceza-1/)
 * (@devaceza-1)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/amp-validation-error/#post-7353650)
 * I am using the WPtouch Pro plugin using the AMP extension provided by that plugin.
 * [http://www.wptouch.com/extensions/amp//](http://www.wptouch.com/extensions/amp//)
 * Regards,
    Aaron
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/amp-validation-error/#post-7353653)
 * ok, use this as a workaround;
 *     ```
       add_filter('autoptimize_filter_noptimize','amp_workaround');
       function amp_workaround($in) {
         if (strpos($_SERVER['REQUEST_URI'],'/amp/')!==false) {
       		return true;
       	} else {
       		return false;
       	}
       }
       ```
   
 * you can add this using [the code snippets plugin](https://wordpress.org/plugins/code-snippets/)
   or in your child theme’s functions.php if you insist 😉
 * frank
 *  Thread Starter [Cowboy Coding](https://wordpress.org/support/users/devaceza-1/)
 * (@devaceza-1)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/amp-validation-error/#post-7353658)
 * Hi Frank,
 * I inserted your code on my child theme’s functions.php and it works!
    Thank you
   so much Frank.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/amp-validation-error/#post-7353667)
 * Nice. I should be back with a more fundamental solution later today, would be
   great if you could test that.
 * frank
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/amp-validation-error/#post-7353676)
 * OK, so the more fundamental fix is in the development-version of Autoptimize,
   you can see it in [this GitHub commit](https://github.com/futtta/autoptimize/commit/3f6a7c51ec6a413bd597324333b21bdc758091a6).
 * It would be great if you could test this on your site (after having disabled 
   the code you just added to your functions.php) by either making the (small) change
   in `wp-content/plugins/autoptimize/autoptimize.php` or by [downloading the zip-file from GitHub](https://github.com/futtta/autoptimize/archive/master.zip)
   and overwriting your `wp-content/plugins/autoptimize` folder with the contents
   of the `autoptimize-master` folder of the zipfile.
 * frank

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘AMP validation error’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/amp-validation-error/#post-7353676)
 * Status: resolved