Title: Duplicate Scripts
Last modified: May 29, 2019

---

# Duplicate Scripts

 *  [vagu71](https://wordpress.org/support/users/vagu71/)
 * (@vagu71)
 * [7 years ago](https://wordpress.org/support/topic/duplicate-scripts/)
 * The plugin adds scripts based on the elements that are added to the pages using
   the page builder.
 * So for example, lets assume that there is an accordion element added on the homepage
   of the website using the page builder, the plugin will add the accordion js to
   the homepage.
 * Now, the issue is that say there is an accordion added to the header of the theme(
   not the page content) (the accordion markup is added to the header.php file in/
   wp-content/plugins/amp-theme-framework-master), in order to make this accordion
   work on the site, the accordion js script needs to be added on all pages (because
   the accordion would appear on each page as it’s in the header). Once this is 
   done, the homepage shows an error, as there are duplicate accordion js files,
   one added by the plugin because there was an accordion added to the homepage 
   content using page builder, and another was added manually because of the accordion
   in the header.php file.
 * Is there a workaround that you’d suggest for this [@ampforwp](https://wordpress.org/support/users/ampforwp/)?
 * Also, I believe that this might be a duplicate of the post [https://wordpress.org/support/topic/duplicate-amp-script-to-pages-that-you-want-to-show-amp-ads/](https://wordpress.org/support/topic/duplicate-amp-script-to-pages-that-you-want-to-show-amp-ads/).
   But couldn’t find an answer on that posts. And the post appears to be closed 
   for new replies.
    -  This topic was modified 7 years ago by [vagu71](https://wordpress.org/support/users/vagu71/).

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

 *  Plugin Author [Ahmed Kaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * (@ahmedkaludi)
 * [7 years ago](https://wordpress.org/support/topic/duplicate-scripts/#post-11587247)
 * Yes, You are right.
 * I have created a ticket for this. [https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/3257](https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/3257)
 * We will allow people to register scripts in a way that it works flawlessly without
   duplicating it.
 *  Thread Starter [vagu71](https://wordpress.org/support/users/vagu71/)
 * (@vagu71)
 * [7 years ago](https://wordpress.org/support/topic/duplicate-scripts/#post-11606461)
 * thanks [@ahmedkaludi](https://wordpress.org/support/users/ahmedkaludi/)!
 *  Thread Starter [vagu71](https://wordpress.org/support/users/vagu71/)
 * (@vagu71)
 * [7 years ago](https://wordpress.org/support/topic/duplicate-scripts/#post-11615629)
 * [@ahmedkaludi](https://wordpress.org/support/users/ahmedkaludi/), by when do 
   you reckon you’ll be adding this to the plugin code? This causes issues when 
   the menu is implemented in the form of an accordion. On pages where there is 
   an accordion in the content, duplicate script errors show up.
 *  Plugin Author [Ahmed Kaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * (@ahmedkaludi)
 * [7 years ago](https://wordpress.org/support/topic/duplicate-scripts/#post-11619556)
 * This ticket is set as a medium priority for us so it will take some time before
   it comes out.
 * But, Why do you have the menus in the form of the accordion?
 * Can you share the link of the page you have built? perhaps there’s a tweak we
   can do to fix this temporarily.

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

The topic ‘Duplicate Scripts’ 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/)

## Tags

 * [ampforwp](https://wordpress.org/support/topic-tag/ampforwp/)

 * 4 replies
 * 2 participants
 * Last reply from: [Ahmed Kaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/duplicate-scripts/#post-11619556)
 * Status: not resolved