The need for accomplishing this task stems from the need to make the Joomla URLs more search engine friendly (SEF). In this tutorial we shall learn how to remove article ID from the URL in Joomla.
Examples of SEF and non-SEF URLs are provided below:
Non-SEF URL – joomguide/index.php?option=com_content&catid=87&Itemid=1964
SEF URL – joomguide.com/remove-article-id-from-url
You can see from the above examples that the SEF URL looks more clean and readable. The same rules apply for search engines as well. In fact, SEF URLs that include the focused keyword for the articles written are known to have some weightage in rankings.
Joomla has configurable SEO settings under Global Configuration and when we enable the SEF URLs and URL Rewriting, all the URLs automatically become SEF. However, the article ID or number still remains intact.
Take a look at this example.
As you can see, the URL contains the article ID 112 and this is after enabling the SEF URLs from the Joomla back-end. So, lets try to remove this number from the URL.
The function to make the Joomla URL completely SEF, also known as the Advanced SEF Mode, has always been a part of Joomla. However, it is still not available on the administrator panel. Therefore, the method that we’re going to implement right now is not officially supported. However, new and smaller sites have successfully implemented this functionality without any drawbacks.
It should be noted that once the Advanced SEF mode is enabled on your Joomla website, the existing URLs that contain the article ids will not work anymore. So if you already have menus pointing to certain articles with ids, please update their links.
Steps to remove article ID from the URL
- Login to your web-hosting control panel.
- Navigate to your Joomla root directory > administrator > components > com_content.
- Open the file config.xml for editing.
- Copy the code below and insert it as illustrated below.[codesyntax lang=”php”]
<field name="sef_advanced_link" type="radio" class="btn-group btn-group-yesno" default="0" label="SEF Advanced Mode" description="Removes the item ID from the Article URL"> <option value="1">JYES</option> <option value="0">JNO</option> </field>
Placement – you can insert the code anywhere within the fieldset.
- Save and close the editor.
- Clear the Joomla cache as well as your browser’s.
Now you can visit your domain and note the changes.
How to disable Advanced SEF Mode
- Login to the Joomla back-end.
- Navigate to Content > Articles > Options.
- Set the SEF Advanced Mode to No.
- Save and close.
By the way, you can simply toggle it off if you face any sort of problems after enabling the Advanced SEF Mode.