Joomla provides a built in class for setting up the meta data of a page in joomla. JFactory::getDocument() will be avaiable in Joomla for setup the meta data.
SEO is very important for all website so the meta data setup we can’t avoid on a web page. Just setting up the meta title ,description will not improve your page ranks should have proper content that match with these title and content.
Now we can discuss how to set meta data of a page in Joomla using JFactory:: getDocument() Class. its simply and easy to understand. From any page you need to set the meta data just make sure your created the JFactory ::getDocument() object.
How to setup the [label style=”3″]Page Title[/label] of page in Joomla using JFactory ::getDocument()
[code style=”1″]
$document = JFactory::getDocument();
$document->setTitle(“This is my page title”);
[/code]
How to setup the [label style=”3″]Meta title[/label] and [label style=”3″]Meta Description[/label] of page in Joomla using JFactory ::getDocument()
[code style=”1″]
$document = JFactory::getDocument();
$document->setMetaData(‘title’, “Your meta title”);
$document->setDescription( “Your meta description” );
[/code]
How to set up the [label style=”3″]keywords[/label] , [label style=”3″]author[/label] and [label style=”3″]robots[/label] etc using JFactory::getDocument()
[code style=”1″]
$document = JFactory::getDocument();
$document->setMetaData(‘keywords’, “keyword1,keyword2, etc.”);
$document->setMetaData(‘robots’, “index,follow”);
$document->setMetaData(‘author’, “Jobin Jose”);
[/code]
Older versions of Joomla required an ” & ” like $document = &JFactory::getDocument();, latest version do not required this “&” just use us above. This will add the meta data on the top of the page.
[label style=”3″]Tips : [/label]
- Page title always should be less than 70 characters.
- Meta description should be 150 to 160 characters.
Hope you will get an idea of Joomla meta data setting options. 🙂 🙂 🙂

There is another part when you want to add any property to meta tag as:
$document->setMetaData('title', "Your meta title");
will do-
but there are cases(as in open graph, when you want to add property like –
For this you can use –
$document->setMetaData('og:type', 'website', 'property');,
or
$type='';
$document->addCustomTag($type);
Thanks for the tips 🙂
Thanks.
Worked for me on some Fabrik generated details pages. Very useful for SEO eg: http://glutenfreedietfinder.com.au/index.php?option=com_fabrik&view=details&formid=5&rowid=318-careme-pastry
I had to create and edit a custom template file in: //public_html/components/com_fabrik/views/details/tmpl/GFDF-details/default_group.php
and change the fabrik list settings to use this template.