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.
Simply follow the steps below to place the additional xml layout update code in each of your sites static cms pages.
Login to the magento admin panel of your site.
Navigate to the ‘cms’ link on the admin navigation and click ‘pages’ link on the sub nav drop down menu.
Click on the static cms page that you wish to add the canonical url tag to from you list of pages.
Click the ‘design’ link on the left hand side navigation menu.
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
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.
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.