Title: Inline WP Scripts not loading on frontend page.
Last modified: April 25, 2024

---

# Inline WP Scripts not loading on frontend page.

 *  Resolved [Rajkiran Bagal](https://wordpress.org/support/users/rajkiranb/)
 * (@rajkiranb)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/inline-wp-scripts-not-loading-on-frontend-page/)
 * Hello, Speed Optimizer Team,
 * I am in the Development Team of SureCart plugin.
 * I am writing on behalf of one of our customer’s.
 * We are adding an inline script on `wp_head` hook like below from our plugin:
 *     ```wp-block-code
       wp_add_inline_script(
       			'surecart-affiliate-tracking',
       			'window.SureCartAffiliatesConfig = {
       				"publicToken": "' . \SureCart::account()->public_token . '",
       				"baseURL":"' . esc_url_raw( untrailingslashit( SURECART_API_URL ) ) . '/v1"
       			};',
       			'before'
       		);
       ```
   
 * But the script tag does not render on the frontend when Speed Optimizer plugin
   is active.
 * The user has Minification, Combination & Defer settings enabled, but even after
   disabling those the script does not render.
 * Can you please help us by providing us some inputs on what we can check to fix
   this issue?
 * Looking forward to hearing from you.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Finline-wp-scripts-not-loading-on-frontend-page%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Pavel Dosev](https://wordpress.org/support/users/pdosev/)
 * (@pdosev)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/inline-wp-scripts-not-loading-on-frontend-page/#post-17714175)
 * Hello [@rajkiranb](https://wordpress.org/support/users/rajkiranb/),
 * You can try excluding the inline script from the SG-optimizer combination by 
   using our custom filters:
 * [https://www.siteground.com/tutorials/wordpress/speed-optimizer/custom-filters/#Plugin_Compatibility](https://www.siteground.com/tutorials/wordpress/speed-optimizer/custom-filters/#Plugin_Compatibility)
   `
   add_filter( 'sgo_javascript_combine_excluded_inline_content', 'js_combine_exclude_inline_script');
   function js_combine_exclude_inline_script( $exclude_list ) {$exclude_list[] ='
   window.SureCartAffiliatesConfig = {';return $exclude_list;}
 * 
   If the problem persists, it would be better to submit a ticket to our support
   team through the User Area with additional details on how to recreate the issue.
   We can then check it on the website itself.
 *  Thread Starter [Rajkiran Bagal](https://wordpress.org/support/users/rajkiranb/)
 * (@rajkiranb)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/inline-wp-scripts-not-loading-on-frontend-page/#post-17716172)
 * Hey [@pdosev](https://wordpress.org/support/users/pdosev/) ,
 * Thank you for your swift assistance!
 * The filter worked & now the inline script is rendering.
 * Have a great day!

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

The topic ‘Inline WP Scripts not loading on frontend page.’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Rajkiran Bagal](https://wordpress.org/support/users/rajkiranb/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/inline-wp-scripts-not-loading-on-frontend-page/#post-17716172)
 * Status: resolved