Title: Remove scripts on pages without buttons?
Last modified: June 3, 2018

---

# Remove scripts on pages without buttons?

 *  Resolved [btees](https://wordpress.org/support/users/btees/)
 * (@btees)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/remove-scripts-on-pages-without-buttons/)
 * I’m trying to reduce the load time of my homepage.
 * I don’t use any of the share buttons on pages, only on products. Is it possible
   to wrap something in a if ( is_product() ){} to make the scripts only load on
   products. Or is there a reason for the scripts to load on pages that don’t have
   share buttons?

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Leland](https://wordpress.org/support/users/addthisleland/)
 * (@addthisleland)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/remove-scripts-on-pages-without-buttons/#post-10357864)
 * Hi [@btees](https://wordpress.org/support/users/btees/)!
 * This is possible to do in 2 primary ways but will require you to install the 
   AddThis script manually and not use the plugin.
 * 1.) You could write a conditional script so that our script is only initialized
   if the product page is loading.
 * 2.) Install the AddThis script just to your product page template. Since every
   theme names their product template differently, I wouldn’t know the exact name
   of your product template but below is the general instruction you can use to 
   guide you on how to install AddThis manually.
 * 1.) Deactivate all AddThis plugins
    2.) Hover over Appearance –> Editor –> PRODUCT-
   TEMPLATE.php (the name might be different in your theme) 3.) Scroll to the very
   bottom 4.) Insert this code (you will need to insert your own Profile ID to replace“
   PUBID” in the below code): <script type=”text/javascript” src=”//s7.addthis.com/
   js/300/addthis_widget.js#pubid=PUBID”></script> 5.) Save the changes to that 
   file
 * Let me know if you have any questions!
 * Thanks,
    Leland

Viewing 1 replies (of 1 total)

The topic ‘Remove scripts on pages without buttons?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/addthis_70cced.svg)
 * [WordPress Share Buttons Plugin – AddThis](https://wordpress.org/plugins/addthis/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/addthis/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/addthis/)
 * [Active Topics](https://wordpress.org/support/plugin/addthis/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/addthis/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/addthis/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Leland](https://wordpress.org/support/users/addthisleland/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/remove-scripts-on-pages-without-buttons/#post-10357864)
 * Status: resolved