Title: Custom JavaScript is not allowed
Last modified: June 26, 2018

---

# Custom JavaScript is not allowed

 *  Resolved [blogdeinstalatii](https://wordpress.org/support/users/blogdeinstalatii/)
 * (@blogdeinstalatii)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/custom-javascript-is-not-allowed-2/)
 * HI,
    I have some errors regarding AMP version of my site in Google Search Console.
 * – Custom JavaScript is not allowed
    /amp/
 * -The AMP URL you refer to is not a AMP
    /centrala-termica-ieftina/amp/
 * Can you help me?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-javascript-is-not-allowed-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [SEOAlien](https://wordpress.org/support/users/seoalien/)
 * (@seoalien)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/custom-javascript-is-not-allowed-2/#post-10436926)
 * Google Search is giving me AMP errors as well.
 * “New AMP error types now visible in Search Console for [sitename]”, and refers
   the code below as the error.
 * `<script>if (document.location.protocol != "https:") {document.location = document.
   URL.replace(/^http:/i, "https:");}</script><script type='text/javascript' src
   ='https://cdn.ampproject.org/v0.js' async></script>`
    -  This reply was modified 7 years, 11 months ago by [SEOAlien](https://wordpress.org/support/users/seoalien/).
 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/custom-javascript-is-not-allowed-2/#post-10437213)
 * [@blogdeinstalatii](https://wordpress.org/support/users/blogdeinstalatii/) You
   do not seem to be using this AMP plugin but rather another one.
 * [@seoalien](https://wordpress.org/support/users/seoalien/) This validation error
   regarding custom JavaScript may be fixed by adding the following code to your
   theme’s `functions.php`:
 *     ```
       add_action( 'pre_amp_render_post', function() {
           remove_all_actions( 'wp_print_scripts' );
       } );
       ```
   
 * This will be fixed in the plugin via [https://github.com/Automattic/amp-wp/issues/1225](https://github.com/Automattic/amp-wp/issues/1225)

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

The topic ‘Custom JavaScript is not allowed’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

## Tags

 * [Custom JavaScript is not allowed](https://wordpress.org/support/topic-tag/custom-javascript-is-not-allowed/)

 * 2 replies
 * 3 participants
 * Last reply from: [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/custom-javascript-is-not-allowed-2/#post-10437213)
 * Status: resolved