Here's the Twitter card image fix for Joomla sites.

  • Wednesday, 21 May 2014

Twitter cards are awesome. When they are set up properly on your site Twitter can display a summary of your article, with an image, right there in the users stream when ever your content is shared. But, by default Twitter isn't able to show images from Joomla sites. It's a very easy fix.

If your Twitter cards are working but not showing images there is a very simple fix. Joomla's robots.txt file blocks access to the images directory. 

The robots.txt file is located in your site root. Open it and remove the following line.

Disallow: /images/

That's it. Easy peasey.

Use the Twitter card validator to check your card is working.

Note. Twitter cards and Open Graph data are not automatically generated by Joomla. There are numerous plugins available to provide this funcitonality. Most plugins only cater for Joomla content. Many of the sites we build have a mix of Joomla items, K2 or Zoo, events, contact pages, etc so I've got my own code that gets built into my templates and customised on a site-by-site basis. But, that will be the subject of another post.

john-pitchers-avatar-300About John Pitchers

John Pitchers is a specialist in back-end Joomla development and development of Joomla based websites. He is also the developer of the FocalPoint maps extension for Joomla. John has been building CMS based web sites since 2004, originally working with Mambo before it became Joomla. When not writing PHP, Javascript or CSS you'll find John carving up the hills around Baldivis on his longboard (long before Walter Mitty made it famous).

Find out more about John on his About.me page and . Follow John on Twitter.