If you have any clients with websites that were built in Joomla, you may have noticed that it's not as naturally SEO friendly as you'd like it to be. One of the most annoying aspects of Joomla 1.7.3 and 2.5.4 is that when you post articles from a blog, the "article ID" number gets indexed in the beginning of the title of the post. For anyone who ranks clients using page titles, this can seemingly ruin your entire strategy.
I was curious to find out whether or not removing the number from the page title would affect SEO for my purposes, and when we figured out how to do it, the article started ranking significantly higher in SERP's. Interestingly enough, there isn't a lot of accurate knowledge on the web about how to resolve this issue, so I thought it would be helpful to write a clear cut article to explain exactly what you can do to fix it.
Step 1
Go into FTP and find this directory:
componentscom_contentrouter.php
Step 2
Open it in an editor and make the following changes:
In function ContentBuildRoute(& query) replace line 27:
$advanced = $params->get('sef_advanced_link', 0);
With:
$advanced = $params->get('sef_advanced_link', 1);
In function ContentParseRoute($segments) replace line 204 (we've run into multiple instances where this is between lines 204 and 208 so just check):
$advanced = $params->get('sef_advanced_link', 0);
With:
$advanced = $params->get('sef_advanced_link', 1);
Comment out lines 228-232
if (strpos($segments[0], ':') === false) { $vars['view'] = 'article'; $vars['id'] = (int)$segments[0]; return $vars; </b> }
Making it:
/* if (strpos($segments[0], ':') === false) { $vars['view'] = 'article'; $vars['id'] = (int)$segments[0]; return $vars;<b></b> }*/
Once you've replaced these areas of code, you will notice that the number disappears from the page title. If your pages are already indexed, the number will most-likely continue to show up for a few days, but after that it will disappear. Because there is no "hide parameter" or other easy fix for this issue, some people believe that Joomla developers did not test this part of the code well enough and that in the future it will be resolved. For now, however, this was the most effective method that we found for removing the article ID's from the page titles. If you know of any other SEO glitches and fixes for Joomla, please share them here!
The only problem is a Joomla update will reset the router.php file and the numbers will appear again. Easy enough to fix, but something you need to be aware of.
Hi Karen, and what about joomla 3.1.5? How can I do that?
same way, hugo.
Nope. Error 404.
Ok found the solution.
Find this in the router.php
->where($db->quoteName(‘alias’) . ‘ = ‘ . $db->quote($db->quote($segment)));
Replace with.
->where($db->quoteName(‘alias’) . ‘ = ‘ . $db->quote($segment));