How to Set Up Popular Caching Plugins with MemberPress?

Everyone wants their websites to load as fast as possible, and even Google gives an advantage to the faster-loading websites in the search results.

The easy way to achieve that in WordPress is to install one of many available caching plugins. However, due to the dynamic nature of MemberPress, installing a caching plugin without setting it up properly, can cause some unwanted consequences. The most serious one is the inability to process transactions properly, and that can cause financial losses to the website owners.

That's why we've decided to list the most popular caching plugins and show how to set them up properly.

All the settings are based on MemberPress defaults for Thank You, Account, Login, and Registration pages, as shown in this image:

The default slugs are: /thank-you, /account, /login, /register plus /unauthorized for handling unauthorized access redirects and /mepr for the internal operations of Webhooks, PayPal IPN URL, etc. If you change any of the first four, or if you add your own registration pages made in some page builder, you'll need to adjust the slugs and URLs accordingly.

Comet Cache

Navigate to Comet Cache -> URI Exclusions and then add /thank-you**, /account**, /login**, /register** /unauthorized** and /mepr** to the text box. Each in its own row. Scroll to the bottom of the page and click the green Save All Changes button. The final result should look like this:

If you're going to use CDN that's built-in in the Pro version, you'd need to add the same to the Blacklisted URI Exclusion Patterns text box, located in the Static CDN Filters section, like this:

Hyper Cache

Navigate to Settings -> Hyper Cache -> Bypasses tab, and then add /thank-you, /account, /login, /register, /unauthorized and /mepr to the Do not cache pages with URIs starting with text box. Each in its own row. Do not forget to click the Enable checkbox. Scroll to the bottom of the page and click the blue Save button. The final result should look like this:

Kinsta Cache

Kinsta Cache is by default installed and activated on all Kinsta hosting plans.

Navigate to Kinsta Cache -> Custom URLs To Purge and add the thank-you, account, login, register, unauthorized and mepr as "Group Path" URLs. Click the purple Add URL button after every entry. Use the Add A Custom URL drop-down selection (marked red) to select Group Path. The final result should look like this:

LiteSpeed Cache

LiteSpeed Cache plugin usually comes preinstalled and activated with every LiteSpeed-based hosting, when you install WordPress. If not, it can be downloaded from here. It will take several steps to set it up so that it doesn't interfere with MemberPress.

Navigate to LiteSpeed Cache -> Settings -> [2] Cache tab and make sure that Cache Logged-in Users and Cache Login Page are set to OFF. Click the Save Changes button in the top right corner before moving to another tab.

Navigate to LiteSpeed Cache -> Settings -> [4] Excludes tab, Do Not Cache URIs section. After that, add /thank-you, /account, /login, /register, /unauthorized and /mepr to the text box. Each in its own row. Scroll to the bottom of the page and click the Save Changes button. The final result should look like this:

If you're going to use CDN, navigate to LiteSpeed Cache -> Settings [8] CDN -> Exclude Path section and add /thank-you, /account, /login, /register, /unauthorized/ and /mepr/ to the text box. Each in its own row. Scroll to the bottom of the page and click the Save Changes button. The final result should look like this:

Navigate to LiteSpeed Cache -> Settings -> [A] Advanced tab and make sure that the Object Cache is OFF.

SG Optimizer 

SG Optimizer is by default, installed and activated when you buy any SiteGround shared hosting plan.

Navigate to SG Optimizer -> Supercacher Settings tab and first disable Memcached at the bottom. After that add thank-you*, account*, login*, register*, unauthorized* and mepr* one by one into the Excluding URLs field and click the blue Exclude button after every entry. The final result should look like this:

Sucuri Firewall

Sucuri Firewall plugin contains caching part too as a paid feature.

Navigate to the Sucuri Firewall Dashboard and click Performance -> Non-Cache URLs. There, just add the full address of the directory or pages you want to avoid caching. You'd need to add /thank-you, /account, /login, /register, /unauthorized and /mepr. Click Add URL button after every entry.

W3 Total Cache

Do not enable Database Cache and Object Cache on Performance -> General Settings page.

Navigate to Performance -> Page Cache -> General and make sure that the option Don't cache pages for logged in users is checked.

Navigate to Performance -> Page Cache -> Never cache the following pages and add /thank-you*, /account*, /login*, /register*, /unauthorized* and /mepr* to the text box. Each in its own row. Scroll to the bottom of the page and click the blue Save Settings & Purge Caches button. The final result should look like this:

WP Fastest Cache

Navigate to WP Fastest Cache -> Settings tab and make sure that the Don't show the cached version for logged-in users option is enabled:

Navigate to WP Fastest cache -> Exclude tab. Click the grey Add New Rule button and add the thank-you, account, login, register, unauthorized and mepr as Starts With URIs:

Click the green Save button to add those URIs one by one. The final result should look like this:

If you experience an issue where the unauthorized page(s) with the login form would just refresh after entering login credentials (while a member would actually be logged in but would have access to only a fraction of the protected content), you might need to add an additional rule of the " Contains:" category, which would prevent caching of those pages. What part of the URL the rule would be based upon, depends on the actual URL. So if those pages would contain "-members" in the URL, you could target that string.

The final result would look like this:

WP-Optimize

Navigate to WP-Optimize -> Settings -> Cache -> Page cache tab and make sure that the option Serve cached pages to logged in users is disabled:

Navigate to WP-Optimize -> Settings -> Cache -> Advanced settings tab and add /thank-you*, /account*, /login*, /register*, /unauthorized* and /mepr* to the text box. Each in its own row. Scroll to the bottom of the page and click the blue Save changes button. The final result should look like this:

WP Rocket

Navigate to Settings -> WP Rocket -> Cache tab -> User Cache section and make sure that Enable cahing for logged-in WordPress users option is disabled:

Navigate to Settings -> WP Rocket -> Advanced Rules tab and add /thank-you/(.*), /account/(.*),  /login/(.*), /register/(.*), /unauthorized/(.*) and /mepr/(.*) to the text box. Each in its own row. Scroll to the bottom of the page and click the orange Save Changes button. The final result should look like this:

If you're going to use the CDN, you should do the same on the CDN tab:

WP Super Cache

Navigate to Settings -> WP Super Cache ->Advanced tab and make sure that Disable caching for logged in visitors. (Recommended) is set:

Navigate to Settings -> WP Super Cache -> Advanced tab. Scroll down the page and add /thank-you, /account/login, /register, /unauthorized and /mepr to the Add here strings (not a filename) that forces a page not to be cached... text box. Each in its own row. After you add all of them click the blue Save Strings button. The final result should look like this:

If you activate built-in Simple CDN then you'll also need to go to the CDN tab and add thank-you, accountlogin, register, unauthorized, mepr, exactly as shown, to the Exclude if substring field, like this:

Instead of conclusion

Please note that all of the plugins listed above contain many more options and features than presented here. Things like minification and caching of HTML, CSS and JavaScript files, removal of query strings, Gzip compression and many others. Those usually do not affect MemberPress and will not be covered here.

You can use GTMetrix website to fine-tune your caching plugin and make your website as fast as possible, without breaking it in the process.

Back to the top

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.