Norbert Miskei Photographer
FEB 05 2014

SEO Enhancements to Joomla!’s com_content Component

Web Design, SEO

There are several shortcomings of the standard content component in Joomla! which is difficult to understand. The Joomla! developers, respect, did an amazing job lately but com_content which should be the foundation of the content management system was kind of neglected. At least from the SEO point of view. The issues:

1. H1 titles globally, oh no!

This is not the com_content’s fault directly but it’s very closely related and it’s probably a result of the same thinking. Most templates are delivering the site name as H1. And on every bloody page. Come on, what would that give us. Every page with the same title? Good way to be ignored by the search engines. Bravo. For example in the standard beez3 template in index.php

                        <h1 id="logo">
                        <?php if ($logo) : ?>
                            <img src="<?php echo $this->baseurl ?>/<?php echo htmlspecialchars($logo); ?>"  alt="<?php echo htmlspecialchars($templateparams->get('sitetitle'));?>" />
                        <?php endif;?>
                        <?php if (!$logo AND $templateparams->get('sitetitle')) : ?>
                            <?php echo htmlspecialchars($templateparams->get('sitetitle'));?>
                        <?php elseif (!$logo AND $config->get('sitename')) : ?>
                            <?php echo htmlspecialchars($config->get('sitename'));?>
                        <?php endif; ?>
                        <?php echo htmlspecialchars($templateparams->get('sitedescription'));?>
                    </div><!-- end logoheader -->

That needs to be changed as the first step. Check in your active template’s index.php if this was the case. Change h1 to span for example and it’s fixed. You could change it to another header tag but again, would you want a h2 or h3 come in front of the h1? No. That would be silly and incorrect. Header tags should be nested in a logical manner.

2. Category and article page headers

The ideal set up should be like this. Category or main page – table or blog layout the same, H1 for the category title and H2 for all the articles nested in the category. Article page, H1 for title. How much is that to ask for?

You can have H1 title with custom browser page title if you assign the article or the category to a menu item. Published or not. But who wants to do twice the work for something that should be standard, right? Plus, let’s say you are delivering news that should be always fresh. You don’t need a menu item for hundreds of articles. So this thinking may be OK, if you have only a handful of articles. Otherwise we must find another solution.

First let’s change the category page header. If your template supports overrides for the following fixes you may want to use it in case you don’t feel safe to change your core files. In case you don’t know how to do that here’s a quick guide.

In your templates directory there should be a folder called “html” if you don’t have it there create the following folder structure inside it. com_content -> views -> category and place here the file you want to override from the components -> com_content -> views -> category -> tmpl folder. In this case the blog.php. Follow the same pattern for other overrides. So, the blog.php, change the h2 tag beginning around line 23 to h1.

Then the next one will be the default.php in the article folder. Here there is another problem in Joomla 3, if you set the article title to hide it will also hide the page heading in case you are using that option. Follow this thread to fix this: Page heading and article title showing/not showing: bug?

And while you are at this particular document I also recommend you to read this article by Dean Marshall Consultancy regarding wrong page titles. Joomla 1.7 Page Title Wrong in Single Article View.

So, that’s it for now. If you have something to add to this please do comment.

There is 1 comment

  • avatar
    Jan Horky on said:

    Great job!

  • Leave a Reply

    Your email address will not be published.

    This site uses Akismet to reduce spam. Learn how your comment data is processed.