Title: Search console error &#8211; Custom JavaScript is not allowed.
Last modified: June 25, 2018

---

# Search console error – Custom JavaScript is not allowed.

 *  Resolved [footy4kids](https://wordpress.org/support/users/footy4kids/)
 * (@footy4kids)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/)
 * Hi
 * Google console is telling me there is some custom JS in one of my pages (see 
   link, above).
 * The code is:
 * <script>if (document.location.protocol != “https:”) {document.location = document.
   URL.replace(/^http:/i, “https:”);}</script><script type=’text/javascript’ async
   src=’[https://cdn.ampproject.org/v0.js’></script&gt](https://cdn.ampproject.org/v0.js’></script&gt);
 * Is it possible to remove this? If so, how?
 * Note: none of my other AMP pages are affected, this code is only in this page.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsearch-console-error-custom-javascript-is-not-allowed%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/page/2/?output_format=md)

 *  Thread Starter [footy4kids](https://wordpress.org/support/users/footy4kids/)
 * (@footy4kids)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10434461)
 * This might be useful:
 * [https://ibb.co/j2GsX8](https://ibb.co/j2GsX8)
 *  [Brad](https://wordpress.org/support/users/saskso/)
 * (@saskso)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10435036)
 * Google says it is a valid AMP page when tested at [https://search.google.com/test/amp](https://search.google.com/test/amp)
   just now. And [https://cdn.ampproject.org/v0/validator.js](https://cdn.ampproject.org/v0/validator.js)
   loads for me without a 404.
 *  Plugin Contributor [ampforwp](https://wordpress.org/support/users/ampforwp/)
 * (@ampforwp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10435484)
 * Hello [@footy4kids](https://wordpress.org/support/users/footy4kids/)
 * I have checked the page URL which you have provided and there is no validation
   error.
 * I have checked the URL on amp test and there is no validation error is occurring.
 * see this screenshot: [http://take.ms/5C00E](http://take.ms/5C00E)
 *  Thread Starter [footy4kids](https://wordpress.org/support/users/footy4kids/)
 * (@footy4kids)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10435779)
 * Hi
 * thanks very much for the reply.
 * Those issues are now fixed but I have another one you may be able to help with.
 * I get a ‘content mismatch’ error on two pages but as far as I can see, the content
   is the same on the amp and non-amp versions (see this screenshot: [https://ibb.co/ie2jvT](https://ibb.co/ie2jvT))
 * Can you assist with this?
 *  Plugin Contributor [ampforwp](https://wordpress.org/support/users/ampforwp/)
 * (@ampforwp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10436171)
 * Hello footy4kids
 * I have checked the URL which you have provided and the content is same in both
   amp and non-amp version can you please wait for the google to recrawl the pages
   and check if the content mismatch error persists or not.
 *  Thread Starter [footy4kids](https://wordpress.org/support/users/footy4kids/)
 * (@footy4kids)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10436795)
 * Ok, thanks 🙂
 *  [alllongday](https://wordpress.org/support/users/alllongday/)
 * (@alllongday)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10438739)
 * Just want to share that I have the same issue. found out that it is caused by
   an ssl plugin trying to put js script to detect and redirect http to https. Disabled
   the option and AMP pages are valid again.
 *  Plugin Contributor [ampforwp](https://wordpress.org/support/users/ampforwp/)
 * (@ampforwp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10439683)
 * Hello [@alllongday](https://wordpress.org/support/users/alllongday/)
 * Thank you for the information.
 * there is no validation error appearing on his website.
 * btw thank you for the information.
 *  [elvisroberto](https://wordpress.org/support/users/elvisroberto/)
 * (@elvisroberto)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10458849)
 * Hi Guys,
 * Need some help with this AMP error(Custom JavaScript is not allowed):
    <script
   type=”text/javascript”>var _cf = _cf || []; _cf.push([‘_setBm’, true]);</script
   ><script type=”text/javascript” src=”/_bm/bd-1-30″></script>
 * Any idea how to fix it?
 * Thanks,
    Elvis
 *  Plugin Contributor [ampforwp](https://wordpress.org/support/users/ampforwp/)
 * (@ampforwp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10465340)
 * Hello [@elvisroberto](https://wordpress.org/support/users/elvisroberto/)
 * Can you please share the URL so I can check and solve it for you.
 * Please let me know.
 *  [elvisroberto](https://wordpress.org/support/users/elvisroberto/)
 * (@elvisroberto)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10477360)
 * Hi [@ampforwp](https://wordpress.org/support/users/ampforwp/),
    This is one of
   the URL that is showing the error: – [https://www.studentuniverse.com/news/2014/09/studentuniverse-partners-with-taiwans-tourism-board/amp/](https://www.studentuniverse.com/news/2014/09/studentuniverse-partners-with-taiwans-tourism-board/amp/)
 * The error is: Custom JavaScript is not allowed
    <script type=”text/javascript”
   >var _cf = _cf || []; _cf.push([‘_setBm’, true]);</script><script type=”text/
   javascript” src=”/_bm/bd-1-30″></script>
 *  [elvisroberto](https://wordpress.org/support/users/elvisroberto/)
 * (@elvisroberto)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10477370)
 * I have two different blogs that are showing me the same AMP error. See to URL
   example bellow:
    – [https://www.studentuniverse.com/blog/world-travel/winter-escapes/7-exotic-destinations-winter-escape/amp](https://www.studentuniverse.com/blog/world-travel/winter-escapes/7-exotic-destinations-winter-escape/amp)
 * – [https://www.studentuniverse.com/news/2015/01/studentuniverse-welcomes-90-international-students-to-london/amp/](https://www.studentuniverse.com/news/2015/01/studentuniverse-welcomes-90-international-students-to-london/amp/)
 * The error is: Custom JavaScript is not allowed
    <script type=”text/javascript”
   >var _cf = _cf || []; _cf.push([‘_setBm’, true]);</script><script type=”text/
   javascript” src=”/_bm/bd-1-30″></script>
    -  This reply was modified 7 years, 10 months ago by [elvisroberto](https://wordpress.org/support/users/elvisroberto/).
    -  This reply was modified 7 years, 10 months ago by [elvisroberto](https://wordpress.org/support/users/elvisroberto/).
    -  This reply was modified 7 years, 10 months ago by [elvisroberto](https://wordpress.org/support/users/elvisroberto/).
    -  This reply was modified 7 years, 10 months ago by [elvisroberto](https://wordpress.org/support/users/elvisroberto/).
 *  Plugin Contributor [ampforwp](https://wordpress.org/support/users/ampforwp/)
 * (@ampforwp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10479880)
 * Hello elvisroberto
 * Can you please update the plugin to latest version 0.9.97.4 and check again.
 * if the issue is not fixed then please deactivate all the plugin which you are
   using apart from AMPforWP plugin and check which plugin adding the script.
 * Please let me know.
 *  [elvisroberto](https://wordpress.org/support/users/elvisroberto/)
 * (@elvisroberto)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10479972)
 * Hi [@ampforwp](https://wordpress.org/support/users/ampforwp/),
    The only version
   that i’m seeing for the AMP for WordPress is 0.7.2, I updated it 2 days ago. 
   I don’t see any update to version 0.9.97.4
 * Best,
    Elis
 *  Plugin Contributor [ampforwp](https://wordpress.org/support/users/ampforwp/)
 * (@ampforwp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/#post-10479994)
 * Hello elvisroberto
 * you are using other AMP plugin so can you please contact on their forum regarding
   your issue so they can fix your issue.
 * this is the link for there support forum.
    [https://wordpress.org/support/plugin/amp](https://wordpress.org/support/plugin/amp)

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/page/2/?output_format=md)

The topic ‘Search console error – Custom JavaScript is not allowed.’ is closed to
new replies.

 * ![](https://ps.w.org/accelerated-mobile-pages/assets/icon-256x256.png?rev=1693616)
 * [AMP for WP - Accelerated Mobile Pages](https://wordpress.org/plugins/accelerated-mobile-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/accelerated-mobile-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/accelerated-mobile-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/accelerated-mobile-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/accelerated-mobile-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/accelerated-mobile-pages/reviews/)

 * 16 replies
 * 5 participants
 * Last reply from: [elvisroberto](https://wordpress.org/support/users/elvisroberto/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/search-console-error-custom-javascript-is-not-allowed/page/2/#post-10480010)
 * Status: resolved