Support » Plugin: Force Login » bypass all woocommerce url’s

  • Resolved adamsmithdlc123



    I am having issues with dynamically generated urls. I have whitelisted all pages to ensure a user can pay for a an item whilst logged out. However they are not forwarded to the order received page since its dynamic:


    I found this piece of code in a similar topic but it does not work for me and I can not access even the /cart/ page.

    * Bypass Force Login to allow for exceptions.
    * @param bool $bypass Whether to disable Force Login. Default false.
    * @return bool
    add_filter( ‘v_forcelogin_bypass’, ‘my_forcelogin_bypass’ );
    function my_forcelogin_bypass( $bypass ) {
    if ( class_exists( ‘WooCommerce’ ) ) {
    if ( is_woocommerce() || is_wc_endpoint_url() ) {
    $bypass = true;
    return $bypass;

    Can you help me with this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Kevin Vess


    Hi– thanks for using Force Login!

    That code example should bypass all WooCommerce URLs (including the cart and order pages) to make them publicly available, as it did for this user:

    Are you using the latest version of WordPress and WooCommerce?

    Is this a multisite install?

    Where did you add this code (in your theme’s functions.php file)?

    Does the v_forcelogin_bypass filter work if you always pass true?

    add_filter( 'v_forcelogin_bypass', '__return_true' );

    Try testing each condition separately to pin-point why $bypass is not set to true.

    Enable WP_DEBUG mode to check for any errors.

    Hi Kevin,

    Yes that is where I got the code from to test it.

    Its a single install.

    Woocommerce version: 3.5.1
    Wordpress version: 5.0.4

    Yes I put this code into functions.php.

    When I always true and I access any page on the website and it worked as expected even for the dynamic url.

    I will try and let you know.


    Hi Kevin,

    I’ve tried emptying the cache and everything seems to work!

    Thank you and sorry to have wasted your time!


    Plugin Author Kevin Vess


    Excellent, I’m glad you got it working!

    Be sure to rate and review my plugin to let others know how you like it.

    Thanks for using Force Login!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘bypass all woocommerce url’s’ is closed to new replies.