If an article is displayed on your Joomla website as part of a Category Blog or Category List, the URL will display its id number.

For example:

http://bj.zemplate.com/protostar-responsive-template/how-to/44-how-to-copy-and-rename-the-protostar-template

Many people (especially your clients) do not like this index number present in the URLs for their web pages.

It is possible to remove the article id number from the URL.

Per this post in forum.joomla.com

http://forum.joomla.org/viewtopic.php?f=706&t=865411

You can edit the components/com_content/router.php file per the instructions below. Do this at your own risk - we are neither recommending this step or not recommending this step. We are simply stating that this can be accomplished. Make a backup of the file before editing the original. When you upgrade Joomla you will need to repeat these steps.

What is different with this router.php file?

After studying this file provided in the post with the standard router.php that came with a Joomla 3.5.0 installation we found three lines were changed (line numbers may vary slightly):

Line 34:

$advanced = $params->get('sef_advanced_link', 1);  
/*******CHANGED FROM 0 TO 1**********/


Line 294:

$advanced = $params->get('sef_advanced_link', 1);
/*******CHANGED FROM 0 TO 1*********/


Line 337:

if($count == 1 AND empty($advanced))
/*****THIS IS CHANGED TO ADD THE "AND empty($advanced)"*******/

Things to consider when taking this step

Issue A: If your site has been up for a long time, and Google and other search engines have indexed your pages, the indexed URLs will all be incorrect for the pages with the index numbers removed.

This means that those links will be broken. You can get around this with redirects in your .htaccess file and resubmitting your site to Google and other major search engines.

Issue B: If you upgrade your site, you will need to remember replace the router.php file with each upgrade, or your URLs will go back to having the id number shown for these pages.

Issue C: If your visitors have bookmarked the pages with the id numbers, these will be broken links if you do not create redirects.

Issue D: If you do take this step, test your site extensively. Especially if you have other contributors that may have hard-coded the URLs for internal links.

When is the best time to take this step?

The best time to take this step is when you are first developing the site, so that the id numbers are not part of the system from the start.

Why does bj.zemplate.com not remove the article id numbers from its URLs

This site has been up for a couple of years now. There are many links out there pointing to the URLs with the id numbers present. It could harm the SEO of the site to remove them at this point. Any future Zemplate sites will be developed without this number present in the URLs.


Has BJ.Zemplate.com helped you with understanding Joomla?

If you would like to make a small contribution to help fund this resource, that would be great, but do not feel obligated in any way.

Donation Amounts


Still not finding a special topic?

Use Google's Search function below for search the content of bj.zemplate.com.