0115 964 8205

Magento has some great functionality for various SEO related elements, one of which is a setting to dynamically add the canonical url tag to pages for you. Despite this Magento doesn’t currently add the canonical url markup to static cms pages automatically.

This however is not an issue as we can simply place the following code into each static cms pages, custom layout update xml.


<reference name="head">
    <action method="addLinkRel">
        <rel>canonical</rel>
        <href>http://www.yoururl.com/goes/here.html</href>
    </action>
</reference>

Ensure that you replace the url contained between the: <href></href> tags with your static pages full url.

How to Add the Canonical URL Tag

Simply follow the steps below to place the additional xml layout update code in each of your sites static cms pages.

Step 1)

Login to the magento admin panel of your site.

Step 2)

Navigate to the ‘cms’ link on the admin navigation and click ‘pages’ link on the sub nav drop down menu.

Step 3)

Click on the static cms page that you wish to add the canonical url tag to from you list of pages.

Step 4)

Click the ‘design’ link on the left hand side navigation menu.

Step 5)

Scroll down the page and locate the content area labelled ‘Custom Layout Update XML’ and paste the canonical url xml update code detailed in this post into this text box.

Ensure that you have changed the url to the full, live url of the particular page that you are editing between the <href></href> tags.

Now click the ‘save page’ button and view the source code of the live page that you have just edited. The canonical url tag should now be within the <head></head> tags of the page.

Share

Author Biography

Mathew


A 14 year industry veteran that specialises in wide array of online marketing areas such as PPC, SEO, front end web development, WordPress and Magento development.

Accredited Google Partner & Bing Ads qualifications, BA (Hons) in Digital Marketing. One half of the Director duo at Kumo.