I
I
Islam Ibakaev2017-10-28 07:54:08
WordPress
Islam Ibakaev, 2017-10-28 07:54:08

How to remove permalinks from products?

I don't need the products to open on a separate page. Is it possible to remove perms, that is, make the post type non-public?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Abramovich, 2017-10-28
@devellopah

Yes, it's possible. But you have to use a separate hook. For example like this,

add_filter( 'woocommerce_register_post_type_product', 'artabr_modify_product_post_type' );
function artabr_modify_product_post_type( $args ) {
   $args['public'] = false;
   $args['publicly_queryable'] = false;
   return $args;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question