Title: Formstack loading css on pages not using Formstack
Last modified: November 19, 2018

---

# Formstack loading css on pages not using Formstack

 *  Resolved [asterbird](https://wordpress.org/support/users/asterbird/)
 * (@asterbird)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/formstack-loading-css-on-pages-not-using-formstack/)
 * Hello,
 * My site [https://andersonudev.wpengine.com/](https://andersonudev.wpengine.com/)
   is loading formstack’s css on the home page, even though I’m not using Formstack
   on that page.
 * The specific file is:
    – [https://www.formstack.com/forms/css/2/wordpress-post.css?ver=4.9.8](https://www.formstack.com/forms/css/2/wordpress-post.css?ver=4.9.8)
 * This slows page load, which is especially critical on the home page.
 * I’m wondering, is there a setting where you can turn off auto-load for formstack’s
   css?
 * Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fformstack-loading-css-on-pages-not-using-formstack%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [7 years, 6 months ago](https://wordpress.org/support/topic/formstack-loading-css-on-pages-not-using-formstack/#post-10896350)
 * Good day [@asterbird](https://wordpress.org/support/users/asterbird/)
 * We admittedly do not have a setting for that and preventing that file from being
   enqueued, but if you’re willing and comfortable enough to do some brief code 
   edits, we can try to provide a workaround for you.
 * Let us know how much you’d be comfortable with and we can start there.
 *  Thread Starter [asterbird](https://wordpress.org/support/users/asterbird/)
 * (@asterbird)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/formstack-loading-css-on-pages-not-using-formstack/#post-10896352)
 * Yes, I’m comfortable making php edits, preferably in the theme functions.php 
   file. Let’s give it a go! 🙂
 *  Plugin Author [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [7 years, 6 months ago](https://wordpress.org/support/topic/formstack-loading-css-on-pages-not-using-formstack/#post-10896733)
 * [@asterbird](https://wordpress.org/support/users/asterbird/) give this a try.
   I’ve tested it out locally, and is working from what I can see.
 * Basically we grab the post content and check for our formstack shortcode, and
   if it’s not present, it dequeues the css.
 *     ```
       function formstack_custom_shortcode_scripts() {
       	global $post;
       	if ( ! has_shortcode( $post->post_content, 'formstack' ) ) {
       		wp_dequeue_style( 'formstack-css' );
       	}
       }
       add_action( 'wp_enqueue_scripts', 'formstack_custom_shortcode_scripts', 11 );
       ```
   
 *  Thread Starter [asterbird](https://wordpress.org/support/users/asterbird/)
 * (@asterbird)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/formstack-loading-css-on-pages-not-using-formstack/#post-10897363)
 * Thanks so much for the code! I’ll try that.
 *  Thread Starter [asterbird](https://wordpress.org/support/users/asterbird/)
 * (@asterbird)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/formstack-loading-css-on-pages-not-using-formstack/#post-10918133)
 * That worked. thank you very much for the code and your help!
 *  Plugin Author [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [7 years, 6 months ago](https://wordpress.org/support/topic/formstack-loading-css-on-pages-not-using-formstack/#post-10918146)
 * Welcome

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

The topic ‘Formstack loading css on pages not using Formstack’ is closed to new 
replies.

 * ![](https://ps.w.org/formstack/assets/icon-256x256.png?rev=2067528)
 * [Formstack Online Forms](https://wordpress.org/plugins/formstack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/formstack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/formstack/)
 * [Active Topics](https://wordpress.org/support/plugin/formstack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/formstack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/formstack/reviews/)

## Tags

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

 * 6 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/formstack-loading-css-on-pages-not-using-formstack/#post-10918146)
 * Status: resolved