How to Assign existing Parent Categories to New Parent Categories to reduce top menu links



  • I want to have three or four major categories in the top menu and combine the other categories underneath them. The new categories will be:

    Is the below the way to do it? This was posted in the PS Forum:

    The question: I have home categories and am looking to move home category 38 into home category 17.

    The category I am trying to move (38) has 3 sub-categories inside for the record. They also have products.

    The answer:

    Just assign the correct parent category and you are done. Backoffice > catalog > categories. The top horizontal menu then rearranges according to the new parent category.

    If the above is not the way, I need a module or a way to do it with a DB edit or something other than manually editing everything.

    Thanks!



  • You can create your new main categories and then assign subcategories to them by editing each category that is planned to be a subcategory and give them their new parent category. Should be easy …



  • @marci123 said in How to Assign existing Parent Categories to New Parent Categories to reduce top menu links:

    You can create your new main categories and then assign subcategories to them by editing each category that is planned to be a subcategory and give them their new home category. Should be easy …

    That’s what I hoped to hear but will I have to set redirects?



  • You mean for google? If your site is listed in the google search console I would just let google reindex your site and it wouldn’t take too long until the new links are listed with google.



  • Yes, Marci. My site is in the GSC. This is sounding much better than I thought. I appreciate your replies.

    Stephanie



  • Which way should I do this and how do I do it:

    Redirect from old URLs to new ones with “redirect 301” in htacces or with php.



  • @alwayspaws said in How to Assign existing Parent Categories to New Parent Categories to reduce top menu links:

    Which way should I do this and how do I do it:

    Redirect from old URLs to new ones with “redirect 301” in htacces or with php.

    You could try this line in your .htaccess file

    Options +FollowSymLinks RewriteEngine On RewriteRule ^(.*)/old-directory/(.*)$ $1/new-directory/$2 [R,L]
    

    Source: https://linchpinseo.com/htaccess-rules/ (at the very end of the page)



  • Thank you, Marci! I’ve thought about it and will probably need to get a module, depending on how much I rearrange my categories. I may not rearrange very many. You’re way ahead of me in the coding! :)



  • Actually I don’t think that you need to buy a module if you just change the category structure. The important links for google are the product links. The structure of a product link is domainname/main-category/productname.

    If the main category of the product remains the same (even if the parent category has been changed) you actually don’t need to redirect anything at all. Category archives are actually duplicate content and many don’t want them to be indexed. So I would only care about single product links. If you change the names of the main category of the products (not the parent category but the category that is checked as main category of the product) then you could add a line like the pattern listed in the example above. For each category change a separate line. Let’s say you want to combine some dog specific categories to a more common “dog supply” category you could redirect the old categories like in the following example

    Options +FollowSymLinks RewriteEngine On RewriteRule ^(.)/dog-food-bowls/(.)$ $1/dog-supply/$2 [R,L]
    Options +FollowSymLinks RewriteEngine On RewriteRule ^(.)/dog-hair-bows/(.)$ $1/dog-supply/$2 [R,L]

    Then all product links from the former dog-food-bowls category would be redirected to the product links in the new dog-supply category. The same with product links in the former dog-hair-bows category.

    The name of the old category comes first and the name of the new category follows



  • This is a lot to take in. :) I’m currently updating existing products that have incorrect combinations. It’s taking days! I’ll re-read this once I’m done. Thank you!


Log in to reply
 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.