Categories
Programming

Magento – Set Meta Title, Description, Keywords and Canonical URL via Layout XML

This handy XML can be used anywhere – your custom modules, CMS pages, product pages, etc.

[xml]
<reference name="head">
<action method="setTitle" translate="title" module="forms"><title>Title</title></action>
<action method="setDescription" translate="title" module="forms"><title>Description</title></action>
<action method="setKeywords" translate="title" module="forms"><title>Keywords</title></action>
<action method="addLinkRel" translate="title" module="forms"><rel>canonical</rel><href>http://www.yoururl.com/</href></action>
</reference>
[/xml]

One reply on “Magento – Set Meta Title, Description, Keywords and Canonical URL via Layout XML”

Comments are closed.