Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7929651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:09:21+00:00 2026-06-03T20:09:21+00:00

Is this possible, or is there some code that can be added so I

  • 0

Is this possible, or is there some code that can be added so I can set a different canonical URL for categories in Magento? I can set for products fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:09:23+00:00Added an answer on June 3, 2026 at 8:09 pm

    Out of the box there is nothing for this that I am aware of. You will need to develop or build your own method of doing this.

    You will need to create an entry in a layout.xml file to put an additional template in the head section of the page when you are on a category page (this would likely be in a catalog_Category_view block). You would also probably need a view file as well as a Block object to fetch the URL you want to use (technically you could put that in the view file, but having the block object is more “Magento”).

    Your layout.xml block would look something like this

    <catalog_category_view>
        <reference name="head">
            <block type="canonical/canonical" name="head_url" as="head_url" template="ocaff/canonical/head.phtml" />
        </reference>
    </catalog_category_view>
    

    This block references a head.phtml file. That file would contain:

    <link rel="canonical" href="<?php echo $this->getCanonicalUrl() ?>" />
    

    This calls back to a block object that has a function called getCanonicalUrl(). In this function you will find and determine what you want the canonical to be. Most likely you want this to be the URL key, but you may have other logic in mind there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Is there a CSS parent selector? Is there some kind of .this
I don't think this is possible but I thought I'd throw it out there.
I'm not sure this is possible, but is there a syntax to be used
I'm not sure if this is possible, is there a way to get the
I'm not sure if this is even possible, but is there a way to
This may not be possible for the carousel but is there a way to
Possible Duplicate: C# - Is there a better alternative than this to ‘switch on
Possible Duplicate: C# member variable initialization; best practice? Is there any benefit to this:
Okay, I need some help here. This is the same old "can't use an
I have a service that gets a JPA entity from outside code. In this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.