最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Unable to update Woocommerce Product Permalink

programmeradmin0浏览0评论

I am using woocommerce with Auto Rent theme found here.

I updated my product permalink using woocommerce permalinks from

xyz/product/product-name 

to

xyz/cars/%product_cat%/product-name.

But this change is not being reflected in the website. It is still following the older link structure. I tried this with localhost as well as cpanel. Still no changes on permalink structure.

Link to my website: carrental.webception.in

Update: Check the screenshot below.

I am using woocommerce with Auto Rent theme found here.

I updated my product permalink using woocommerce permalinks from

xyz/product/product-name 

to

xyz/cars/%product_cat%/product-name.

But this change is not being reflected in the website. It is still following the older link structure. I tried this with localhost as well as cpanel. Still no changes on permalink structure.

Link to my website: carrental.webception.in

Update: Check the screenshot below.

Share Improve this question edited Oct 24, 2016 at 4:43 Vishwasa Navada K asked Oct 24, 2016 at 4:19 Vishwasa Navada KVishwasa Navada K 1115 bronze badges 7
  • Where you've changed the permalink structure ? – CodeMascot Commented Oct 24, 2016 at 4:36
  • @the_dramatist sorry for not mentioning that. Check the updated question. – Vishwasa Navada K Commented Oct 24, 2016 at 4:43
  • What is your Product Category Base value ? – CodeMascot Commented Oct 24, 2016 at 5:00
  • @the_dramatist its cat-type – Vishwasa Navada K Commented Oct 24, 2016 at 5:03
  • Do you have any SEO plugin or WPML installed ? – CodeMascot Commented Oct 24, 2016 at 5:06
 |  Show 2 more comments

1 Answer 1

Reset to default 1

Add this code to your functions.php-

add_action( 'init', 'the_drmatist_category_base' );
function the_drmatist_category_base() {
// Remember to flush the rules once manually after you added this code!
    add_rewrite_rule(
    // The regex to match the incoming URL
        'news/([^/]+)/([^/]+)/([^/][^f][^e][^e][^d]+)(/[0-9]+)?/?$', //here my changes to exclude 'feed'
        // The resulting internal URL
        'index.php?product_cat=$matches[1]/$matches[2]&name=$matches[3]&paged=$matches[4]',
        // Add the rule to the top of the rewrite list
        'top' );
}

Then Save Changes on you Permalinks settings page and then try again please. And let me know what happens.

发布评论

评论列表(0)

  1. 暂无评论