Try this
add_filter( 'rewrite_rules_array', function( $rules )
{
$new_rules = array(
'services/([^/]*?)/page/([0-9]{1,})/?$' => 'index.php?product_cat=$matches[1]&paged=$matches[2]',
'services/([^/]*?)/?$' => 'index.php?product_cat=$matches[1]',
'services/([^/]*?)/([^/]*?)/?$' => 'index.php?product_cat=$matches[2]'
);
return $new_rules + $rules;
} );
Related Posts:
- Custom URL for each product variation – rewrite rules
- Custom rewrite for product variation not working
- /page/ is not working with a custom permalink structure (WooCommerce)
- Add rewrite rule to make Woocommerce product category page seo friendly
- Custom WooCommerce rewrite rules with comma delimiter
- Rewrite rules for sub category (child product categry & grand-child)
- Custom account page that accepts a query parameter
- add_rewrite_rule() returns 404 page
- Tags pages for different Custom Post Types and WooCommerce Products sharing Post Tags
- Woocommerce Product category base same as product base causes 404
- url rewrite doesn’t load woocommerce product
- Change variants URL
- Pass custom Checkout field value to Stripe gateway in WooCommerce
- WooCommerce Shop Page Not Found 404
- How can I show an empty WooCommerce cart? [closed]
- Woocommerce : How to attach an custom attachment with customer-processing-order.php email template [closed]
- Woocommerce Pre Orders – Can i override templates?
- Woocommerce checkout via external page [closed]
- Programmatically adding product attributes to WP / Woo commerce
- Display File Types For Woocommerce Downloadable Products On Product Page
- Apply Additional Discount after coupon
- Is it possible to add a sidebar to Storefront’s Welcome page
- Programmatically setting Woocommerce product price
- Woocommerce reviews xss issue [closed]
- Woocommerce REST API allow normal users make an order
- WooComerce shows blank site (Shop)
- How to update custom field in WooCommerce
- Add product categories to receipt
- Woocommerce specific product template for product type
- How can I use a gravity form to send an e-card?
- How to select default Woocommerce category page
- Creating Product Table using Gutenberg
- I can ‘t display product images based on the label
- SKU for each product on every page
- Timber, Twig, and Woocommerce: Last product stays in the cart after checkout
- Woocommerce Cart Default Language Not Changing
- Make this Fast and Queryable
- WooCommerce slider filter for numerical attributes
- create custom layout product list woocommerce [closed]
- Reordering product tab under product image [closed]
- How do I change the default state label for a country on the WooCommerce checkout page?
- WooCommerce Tax Filter Not Fired [closed]
- woocommerce – customise notice error in checkout page
- Using a filter to change a path
- Woocommerce, prevent login after registration and redirect to custom URL
- Order with custom order status disappeared once the page is refreshed
- WooCommerce Product detail page: Add content under thumbnails [closed]
- How to add product filter dropdown in woo commerce order page?
- How to make a custom button that redirects to a “user specified link while entering product details” woocommerce
- Unable to paste google analytics con header.php [closed]
- wordpress/woocommerce login url not redirecting correctly
- Add Attribute to Woocommerce programatically, doesn’t display front end [closed]
- How do i make this snippet work for order history page woocomerce
- Set QTY to 0 With WP All Import from CSV
- Link a button to woofunnels model
- Woocommerce – Add additional item if some item wants to be added to the cart?
- Hook “wp_trash_post” executing multiple time in case of bulk trash products
- WooCommerce Subscriptions: Hide one variation subscription
- Contact form 7 send product PDF after submit
- Add sub variations in product page
- Woo commerce product quantity wise SKU
- Override une fonction dans une class Woocommerce
- validation field form registration vendor dokan woocommerce
- Delete unpublished woocommerce products
- List of JS events in the WooCommerce frontend
- Woocommerce / Product Columns on Shop Loop / Responsive
- I’m getting error Ultimate WooCommerce Filters
- No Results in WooCommerce Product Search
- WooCommerce Product Search box with 3 dropdown menus
- Split taxonomies on different pages
- woocommerce REST api on the website’s front-end
- Can’t add Select2 to select in variable product (admin)
- How to do_action after some plugin{woocs} loaded?
- How can I change field values of posts before displaying
- Working with a json feed & trying to figure out how best to import
- Editing fields required in the WooCommerce / WordPress registration form [closed]
- WC Booking query bookings with date ranges
- The orders in WooCommerce admin are hidden (they have the “hidden” CSS class)
- Disable theme WooCommerce template [closed]
- WooCommerce: how to set stock per attribute on variable product
- How to display products in sidebar in 2 columns?
- Increase load-out-page speed
- WooCommerce Stucked (?) – Edit dimensions
- woocommerce – undelete posts
- How to add a fixed shopping cart button on the bottom of the page?
- WooCommerce: Bulk Quantity in Cart
- Remove Span Class From Woocommerce Price
- Woocommerce shows empty columns [closed]
- Product atributes in title of order (not in description)
- How to create custome pdf file of my invioice in wordpress
- How to get sub items of parent menu item?
- WordPress and WooCommerce How to Assign Attribute Based Pricing
- unable to get product by category only getting product added lastly
- Storefront Child Theme show product attribute [closed]
- error 500 in Back Office when using a woocommerce function in functions.php
- Sort by price when price is set in multiple keys
- Add a custom code with custom link after add to cart for every product
- WooCommerce product permalink based on product’s current category
- Disable duplicate WC product category URLs
- how should i get products based on tags in woocommerce