Adding Custom Category Attributes to Magento

Save yourself time and possibly money by following this article to create a simple custom attribute to your category panel in Magento – this article has been tested on CE 1.9.1.


Here is some explanation of what this article is going to achieve – (not something other articles I had followed did). We are going to be creating an Module Called SEO, grouped in a collection called Rhino. This extension will add a single text field to the bottom of the General Information tab of the Edit Category panel.

Remember that everything is Case sensitive (something other articles did not concern themselves with) it will save you a lot of time if you stick to that.

Step 1 – Module XML
Create you Module xml file here: /app/etc/modules/Rhino_Seo.xml


Step 2 – Module Config XML
Create your module config xml file here: /app/code/local/Rhino/Seo/etc/config.xml


Step 3 – Install Script PHP
Create your install script here: /app/code/local/Rhino/Seo/sql/Seo_setup/mysql4-install-0.3.0.php
(The version number must match the version specified in the config.xml, the folder path is reflected by the tags within the XML of the config.xml – and remember it is all case sensitive.

Change the CUSTOM_ATTRIBUTE_CODE with your code, and CUSTOM_ATTRIBUTE_LABEL with the descriptive label which will appear next to it on the Category edit panel.

Step 4 – Clear the Cache
Clear your Magento Cache, and log out for good measure and you should find your newly created field on the edit Category Page.


The first article I read on this subject was pretty poor when it came to consistency but it did offer advice on debugging which I did not find anywhere else.

If things didn’t work out, firstly check your core_resource table to see if the installation script actually ran. If it did, you should see a row with your attribute code and the correct version. If it’s missing, make sure you cleared your cache and double-check your installation script file name, path and version number.

If it looks like it ran, check your eav_attribute table and make sure that the attribute is there. If not, the problem is in your installer script.

Using Your new Attribute
Once you are done, you can use something like this
assuming category is an instance of Mage_Catalog_Model_Category. Not to state the obvious but the function name should be in Camel Case.

You want a drop-down/select box instead of a textfield?
Change input to select and supply the data to be available in the drop down in the form of a nested array under option.

I hope someone finds this article useful!

Published by


I am a 80's child - the NES, N64 generation old enough to remember Boulder dash - young enough to play Call of Duty. I have been developing in PHP for over 10 years - I've been working in Unity 3D for the past 6 months as I expand my skills into Games Development - Magento development helps to pay the bills.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">