Title: Exclude Amp script
Last modified: August 6, 2019

---

# Exclude Amp script

 *  Resolved [anoirinoh](https://wordpress.org/support/users/anoirinoh/)
 * (@anoirinoh)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/exclude-amp-script/)
 * Hi there,
    Thanks for the great plugin, when I activated it, it breaks the amp
   validator giving this error `The mandatory tag 'amphtml engine v0.js script' 
   is missing or incorrect`. I am wondering if you could help excluding the Amp 
   script from moving to the footer, I don’t know the script slug. Anyway here is
   the script link: <script type=”text/javascript” src=”[https://cdn.ampproject.org/v0.js&#8221](https://cdn.ampproject.org/v0.js&#8221);
   async></script> Thanks

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

 *  Plugin Author [Joshua David Nelson](https://wordpress.org/support/users/joshuadnelson/)
 * (@joshuadnelson)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/exclude-amp-script/#post-11807052)
 * Hey [@anoirinoh](https://wordpress.org/support/users/anoirinoh/)!
 * Thanks for posting this issue.
 * I’ll do some testing with the amp plugin. Are you using the “official” [AMP](https://wordpress.org/plugins/amp/)
   plugin or the [AMP for WP](https://wordpress.org/plugins/accelerated-mobile-pages/)
   plugin?
 * My initial thought is that Scripts to footer shouldn’t run on amp endpoints at
   all, since you’ll be handling scripts so differently in those conditions.
 * Thanks,
    Joshua
 *  Thread Starter [anoirinoh](https://wordpress.org/support/users/anoirinoh/)
 * (@anoirinoh)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/exclude-amp-script/#post-11809432)
 * Hi [@joshuadnelson](https://wordpress.org/support/users/joshuadnelson/)
    Thank
   you for the quick reply, I am using the official AMP plugin, yeah, I think we
   should exclude script to footer plugin from running on AMP pages, I have found
   a similar fix for litespeed cache, I think code like this:
 * `function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() && ! defined( 'LITESPEED_NO_LAZY')&&
   define( 'LITESPEED_NO_LAZY', true ) ;`
    could fix the issue but I don’t know 
   the variables I should replace.
 * Thanks
 *  Plugin Author [Joshua David Nelson](https://wordpress.org/support/users/joshuadnelson/)
 * (@joshuadnelson)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/exclude-amp-script/#post-11809657)
 * Yea, great! I’ll work on a change and try to have an update out soon.
 * In the meantime, the main `stf_include` [filter](https://github.com/joshuadavidnelson/scripts-to-footer/wiki#filters)
   should work:
 *     ```
       function stf_amp_filter( $include ) {
   
           if( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() )
               $include = false;
   
           return $include;
       }
       add_filter( 'stf_include', 'stf_amp_filter' );
       ```
   
    -  This reply was modified 6 years, 9 months ago by [Joshua David Nelson](https://wordpress.org/support/users/joshuadnelson/).
 *  Thread Starter [anoirinoh](https://wordpress.org/support/users/anoirinoh/)
 * (@anoirinoh)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/exclude-amp-script/#post-11857078)
 * Hi there,
    Thank you for your reply and sorry for the late response. I tried 
   the code you cited above without any results and still getting the issue, any
   alternative solution?
 *  Plugin Author [Joshua David Nelson](https://wordpress.org/support/users/joshuadnelson/)
 * (@joshuadnelson)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/exclude-amp-script/#post-11861402)
 * Hey again!
 * Sorry that didn’t work for you! I’m on vacation at the moment, but I’ll test 
   this out a bit more and get a solution for you (either a plugin update or custom
   code) next week.
 * Thanks,
    Joshua
 *  Plugin Author [Joshua David Nelson](https://wordpress.org/support/users/joshuadnelson/)
 * (@joshuadnelson)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/exclude-amp-script/#post-12416170)
 * Hey [@anoirinoh](https://wordpress.org/support/users/anoirinoh/) – apologies 
   on my delay here. Can you confirm if this is still an issue for you in the current
   versions of AMP (1.4.2) and Scripts To Footer (0.6.4)? I’ve tried to replicate
   this issue, but AMP is working as expected on my end.
 * It could be related to a specific configuration, though. Are you using the “Standard,“
   Traditional,” or “Reader” website mode? (Setting in AMP > General)

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

The topic ‘Exclude Amp script’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/scripts-to-footerphp_fcfefd.svg)
 * [Scripts To Footer](https://wordpress.org/plugins/scripts-to-footerphp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/scripts-to-footerphp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/scripts-to-footerphp/)
 * [Active Topics](https://wordpress.org/support/plugin/scripts-to-footerphp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/scripts-to-footerphp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/scripts-to-footerphp/reviews/)

 * 6 replies
 * 1 participant
 * Last reply from: [Joshua David Nelson](https://wordpress.org/support/users/joshuadnelson/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/exclude-amp-script/#post-12416170)
 * Status: resolved