• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Tips and Tricks » How to properly load (and unload) stylesheets

How to properly load (and unload) stylesheets

Chad Butler · Mar 26, 2025 ·

This article is provided free. Find out how you can get full access to premium content, including how-to articles and support forums, as well as priority email support and member exclusive plugin extensions..

 

WP-Members comes packaged with a default stylesheet, which tries to be a generic as possible in order to look good in as many use-cases as possible. However, this may not be suitable in all instances. Ideally, in all cases, you would create a custom stylesheet that fits into your other style elements to match your existing theme.

In order to load a custom stylesheet, WP-Members has an option in the plugin’s main settings.

If the stylesheet setting is left blank, the plugin’s default stylesheet will load. If you have a custom stylesheet somewhere, you can identify its full URL here. NOTE: There is no use a stylesheet that is already loaded. If you are relying on a stylesheet in your theme, that already loads from the theme. There is no need to enter it here or it will just be loading a second time (creating unnecessary increase in your page load).

If you want no stylesheet for the plugin at all (such as in the case where your theme’s stylesheet covers it), then you need to dequeue the plugin’s stylesheet. You can do that with the following code snippet added to your theme’s functions.php file (or wherever you store custom code snippets):

add_action( 'wp_enqueue_scripts', function() {
    wp_dequeue_style( 'wp-members' );
},100);

If you want to unload the WP-Members stylesheet while at the same time loading a custom stylesheet programmatically, you can do it like this:

add_action( 'wp_enqueue_scripts', function() {
    
    // Note: this just dequeues the wp-members default.
    // This can be used just to load a custom stylesheet as well,
    // in which case you can omit this particlar call.
    wp_dequeue_style( 'wp-members' );
    
    // Give your style a "handle" and identify the URL path to the stylesheet.
    // Note: test the URL in your browser. If it doesn't load in your browser
    // it won't load in the page either.
    wp_enqueue_style( 'my-style', 'https://mysite.com/my/path/to/custom.css' );
    
},100);

Note that adding a custom stylesheet with the above can be done this way regardless of whether you are unloading the WP-Members stylesheet or not. Enqueueing this way is a standard WP method, so you can use it to load another stylesheet for WP-Members in addition to what is already loaded, or you can use it to load a stylesheet for something else as well. In fact, you can use this method to unload styles for anything that is loaded by unqueueing (which is the proper WP way to do it) making this a valuable way to fully customize your site so that your plugins blend perfectly into your look-and-feel.

Tips and Tricks wp_dequeue_style, wp_enqueue_scripts

Ready to get started?

Join Today!

© 2025 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Privacy Policy
  • Refund Policy