E4TSteve
E4TSteve

Reputation: 23

Why are my Woocommerce permalinks conflicting with main website pages?

Was wondering if someone could point me in the right direction.

My current Woocommerce Permalink settings are as follows:

SHOP www.mywebsite.com/shop

SHOP WITH SUB CATEGORY www.mywebsite.com/seasons/winter

Unfortunately, the above SHOP WITH SUB CATEGORY link also works without the product category - i.e. www.mywebsite.com/winter - for some reason.

Which is annoying as I also have a main page in my website called Winter. (i.e. mywebsite.com/winter).

I have tried various versions of the COMMON, OPTIONAL and PRODUCT permalinks, but no matter what I type, www.mywebsite.com/winter always points to the Woocommerce Shop page and not the normal website page.

Any ideas?

Huge thank you in advance :) Steven

Upvotes: 0

Views: 64

Answers (1)

Bart Klein Reesink
Bart Klein Reesink

Reputation: 122

What happens when you use this? This code stops WordPress from guessing where to go.

function no_redirect_guess_404_permalink( $header ){
    global $wp_query;

    if( is_404() )
        unset( $wp_query->query_vars['name'] );

    return $header;
}

add_filter( 'status_header', 'no_redirect_guess_404_permalink' );

Original answer

Upvotes: 0

Related Questions