Title: Only load plugin on specific pages
Last modified: February 12, 2018

---

# Only load plugin on specific pages

 *  Resolved [rzack](https://wordpress.org/support/users/rzack/)
 * (@rzack)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/only-load-plugin-on-specific-pages/)
 * Hello, and thanks again for the great plugin.
 * We’re using Super Socializer for Social Login only. It appears that the Super
   Socializer code is only then required on the Login and Register pages.
 * However, Super Socializer appears to be always loading its scripts/styles on 
   every page on the site, which is causing some conflicts with other plugins and
   some slowdowns for the site. For example, this code is in the top of every page:
 *     ```
       <script type="text/javascript">var theChampCloseIconPath = 'https://our.news/wp-content/plugins/super-socializer/images/close.png';var heateorSsSDKBlockedMsg = <code>Your browser is blocking some features of this website. Please follow the instructions at <a href=\'http://support.heateor.com/browser-blocking-social-features/\' target=\'_blank\' style=\'color:#33a9d8\'>http://support.heateor.com/browser-blocking-social-features/</a> to unblock these.</code></script>
       <script> var theChampSiteUrl = 'https://our.news', theChampVerified = 0, theChampEmailPopup = 0; </script>
       <script> var theChampFBKey = '<redacted>', theChampFBLang = 'en_US', theChampFbLikeMycred = 0, theChampSsga = 0, theChampCommentNotification = 0, theChampHeateorFcmRecentComments = 0, theChampFbIosLogin = 0; </script>
       <style type="text/css">
       	.the_champ_horizontal_sharing .theChampSharing{
       	color: #fff;
       	border-width: 0px;
       	border-style: solid;
       	border-color: transparent;
       	}
       ```
   
 * Social Commenting, Social Sharing, and Like Buttons are all disabled in the admin
   dashboard, but that code above still appears on every page.
 * We even tried dequeuing some of the scripts/styles in functions.php, but that
   doesn’t appear to work as this code appears to not be enqueued normally.
 * Is there any way for us to specify to only load this plugin on the Login and 
   Register pages, and/or remove the code it inserts on all other pages?
    Thank 
   you!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fonly-load-plugin-on-specific-pages%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Heateor Support](https://wordpress.org/support/users/heateor/)
 * (@heateor)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/only-load-plugin-on-specific-pages/#post-9970489)
 * Hi there,
 * We will improve this aspect in upcoming releases.
 * > We even tried dequeuing some of the scripts/styles in functions.php, but that
   > doesn’t appear to work as this code appears to not be enqueued normally
 * You need to dequeue the files in the same fashion in which these are enqueued.
   You can do that like described below:
 *     ```
       /**
        * Initiate dequeue call on 'init' event
        */
       function heateor_ss_dequeue_init() {
           add_action( 'wp_enqueue_scripts', 'heateor_ss_dequeue_scripts_css' );
       }
       add_action( 'init', 'heateor_ss_dequeue_init' );
   
       /**
        * Dequeue CSS and Javascript on the required pages
        */
       function heateor_ss_dequeue_scripts_css() {
           wp_dequeue_script( 'the_champ_ss_general_scripts' );
           // you can dequeue more scripts and CSS
       }
       ```
   
 *  [Phil](https://wordpress.org/support/users/magicfilou/)
 * (@magicfilou)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/only-load-plugin-on-specific-pages/#post-9970653)
 * Hi!
 * Yep, I hope you will release a new version soon to show your code only on page
   where we call your functions …. As you know we are fighting against time loading
   on every page, so useless codes are indesirable
 * TIA
 *  Thread Starter [rzack](https://wordpress.org/support/users/rzack/)
 * (@rzack)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/only-load-plugin-on-specific-pages/#post-9970695)
 * Thank you, however, we tried that dequeue code and it also does not seem to work.
   Likely since you aren’t always enqueuing ALL the style/scripts but hard coding
   their insertion. For example, line 125 of super_socializer.php:
 * `<script>function theChampLoadEvent(e){var t=window.onload;if(typeof window.onload!
   ="function"){window.onload=e}else{window.onload=function(){t();e()}}}</script
   >`
 * Dequeuing won’t work since this script is being hard-coded and not enqueued.
   
   Please fix in next release. Thank you!
    -  This reply was modified 8 years, 3 months ago by [rzack](https://wordpress.org/support/users/rzack/).
 *  [wp-Spirit](https://wordpress.org/support/users/wp-spirit/)
 * (@wp-spirit)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/only-load-plugin-on-specific-pages/#post-9976752)
 * Hi everyone !
 * Thanks for this great plugin ! I have the same problem of rzack.
 * Please fix it soon. Thank you!
 *  Plugin Author [Heateor Support](https://wordpress.org/support/users/heateor/)
 * (@heateor)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/only-load-plugin-on-specific-pages/#post-9977475)
 * [@magicfilou](https://wordpress.org/support/users/magicfilou/) [@wp-spirit](https://wordpress.org/support/users/wp-spirit/)
   
   Okay. We will do it soon.
 * > Thank you, however, we tried that dequeue code and it also does not seem to
   > work
 * Dequeue function will dequeue only the `.js` files which are adding to webpage
   load time. We will improve it further.

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

The topic ‘Only load plugin on specific pages’ is closed to new replies.

 * ![](https://ps.w.org/super-socializer/assets/icon-128x128.png?rev=1866723)
 * [Social Share, Social Login and Social Comments Plugin - Super Socializer](https://wordpress.org/plugins/super-socializer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/super-socializer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/super-socializer/)
 * [Active Topics](https://wordpress.org/support/plugin/super-socializer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/super-socializer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/super-socializer/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [Heateor Support](https://wordpress.org/support/users/heateor/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/only-load-plugin-on-specific-pages/#post-9977475)
 * Status: resolved